camel-private.h Drop the Win32 fsync() implementation. Instead just use
authorTor Lillqvist <tml@novell.com>
Fri, 6 Jun 2008 11:00:55 +0000 (11:00 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 6 Jun 2008 11:00:55 +0000 (11:00 +0000)
2008-06-06  Tor Lillqvist  <tml@novell.com>

* camel-private.h
* camel-win32.c: Drop the Win32 fsync() implementation. Instead
just use _commit() in the Microsoft C library which does the same.

* Makefile.am: Link libcamel with ICONV_LIBS.

svn path=/trunk/; revision=8945

camel/ChangeLog
camel/camel-private.h
camel/camel-win32.c

index 880df6e..c8b837a 100644 (file)
@@ -1,3 +1,11 @@
+2008-06-06  Tor Lillqvist  <tml@novell.com>
+
+       * camel-private.h
+       * camel-win32.c: Drop the Win32 fsync() implementation. Instead
+       just use _commit() in the Microsoft C library which does the same.
+
+       * Makefile.am: Link libcamel with ICONV_LIBS.
+
 2008-05-29  Milan Crha  <mcrha@redhat.com>
 
        ** Part of fix for bug #534312
index 641039b..69b59b8 100644 (file)
@@ -190,7 +190,7 @@ struct _CamelCertDBPrivate {
        (g_mutex_unlock (((CamelCertDB *) (db))->priv->l))
 
 #ifdef G_OS_WIN32
-int fsync (int fd);
+#define fsync(fd) _commit(fd)
 
 const char *_camel_get_localedir (void) G_GNUC_CONST;
 const char *_camel_get_libexecdir (void) G_GNUC_CONST;
index f4c7ae5..818beef 100644 (file)
@@ -76,31 +76,3 @@ _camel_get_##varbl (void)                    \
 GETTER(localedir)
 GETTER(libexecdir)
 GETTER(providerdir)
-
-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;
-}
-