diff options
author | Tor Lillqvist <tml@novell.com> | 2005-12-17 19:45:52 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2005-12-17 19:45:52 +0800 |
commit | 22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a (patch) | |
tree | 470287f82c9473740aea30e4e64be315258fb64e /e-util | |
parent | 4ded439d958853c6e276162fb8dc6f2724477cbc (diff) | |
download | gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.tar gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.tar.gz gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.tar.bz2 gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.tar.lz gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.tar.xz gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.tar.zst gsoc2013-evolution-22e9edd52a0e6ca23edc14e3ef24fba4da8dc13a.zip |
e-util-private.h (fsync) Don't bother with a Win32 implementation of
2005-12-17 Tor Lillqvist <tml@novell.com>
* e-util-private.h (fsync)
* e-util.c: Don't bother with a Win32 implementation of fsync() as
the uses of fsync() in evo are pretty irrelevant. Just #define
fsync() away on Win32.
svn path=/trunk/; revision=30796
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 7 | ||||
-rw-r--r-- | e-util/e-util-private.h | 2 | ||||
-rw-r--r-- | e-util/e-util.c | 31 |
3 files changed, 8 insertions, 32 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 4065a68ca2..bd66cbe4bb 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,10 @@ +2005-12-17 Tor Lillqvist <tml@novell.com> + + * e-util-private.h (fsync) + * e-util.c: Don't bother with a Win32 implementation of fsync() as + the uses of fsync() in evo are pretty irrelevant. Just #define + fsync() away on Win32. + 2005-12-12 Irene Huang <Irene.Huang@sun.com> reviewed by: Veerapuram Varadhan <vvaradhan@novell.com> diff --git a/e-util/e-util-private.h b/e-util/e-util-private.h index f40b09f674..35cf0cf5c2 100644 --- a/e-util/e-util-private.h +++ b/e-util/e-util-private.h @@ -33,7 +33,7 @@ #ifdef G_OS_WIN32 -int fsync (int fd); +#define fsync(fd) 0 const char *_e_get_category_icons (void) G_GNUC_CONST; const char *_e_get_datadir (void) G_GNUC_CONST; diff --git a/e-util/e-util.c b/e-util/e-util.c index 5b7875293d..b2efe75f95 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -1276,34 +1276,3 @@ e_gettext (const char *msgid) return dgettext (E_I18N_DOMAIN, msgid); } - -#ifdef G_OS_WIN32 - -int -fsync (int fd) -{ - int handle; - struct stat st; - - handle = _get_osfhandle (fd); - if (handle == -1) - return -1; - - fstat (fd, &st); - - /* FlushFileBuffers() fails if called on a handle to the - * console output. As we cannot know whether fd refers to the - * console output or not, punt, and call FlushFileBuffers() - * only for regular files and pipes. - */ - if (!(S_ISREG (st.st_mode) || S_ISFIFO (st.st_mode))) - return 0; - - if (FlushFileBuffers ((HANDLE) handle)) - return 0; - - errno = EIO; - return -1; -} - -#endif |