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
+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
(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;
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;
-}
-