summaryrefslogtreecommitdiff
path: root/gconf/gconfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'gconf/gconfd.c')
-rw-r--r--gconf/gconfd.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gconf/gconfd.c b/gconf/gconfd.c
index 66c18ffc..2827635d 100644
--- a/gconf/gconfd.c
+++ b/gconf/gconfd.c
@@ -62,6 +62,36 @@
#include <conio.h>
#define _WIN32_WINNT 0x0500
#include <windows.h>
+
+static int
+fsync (int fd)
+{
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ DWORD err;
+
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+
+ if (!FlushFileBuffers (h))
+ {
+ err = GetLastError ();
+ switch (err)
+ {
+ case ERROR_INVALID_HANDLE:
+ errno = EINVAL;
+ break;
+
+ default:
+ errno = EIO;
+ }
+ return -1;
+ }
+
+ return 0;
+}
#endif
/* This makes hash table safer when debugging */