g_fsync isn't available until 2.63 so we need a compat
wrapper temporarily.
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
# util/glibcompat.h
+vir_g_fsync;
vir_g_strdup_printf;
vir_g_strdup_vprintf;
#include <config.h>
#include <stdlib.h>
+#include <unistd.h>
#include "glibcompat.h"
#undef g_strdup_printf
#undef g_strdup_vprintf
+#undef g_fsync
/* Due to a bug in glib, g_strdup_printf() nor g_strdup_vprintf()
* abort on OOM. It's fixed in glib's upstream. Provide our own
abort();
return ret;
}
+
+
+gint
+vir_g_fsync(gint fd)
+{
+#ifdef G_OS_WIN32
+ return _commit(fd);
+#else
+ return fsync(fd);
+#endif
+}
G_GNUC_PRINTF(1, 2);
char *vir_g_strdup_vprintf(const char *msg, va_list args)
G_GNUC_PRINTF(1, 0);
+gint vir_g_fsync(gint fd);
#if !GLIB_CHECK_VERSION(2, 64, 0)
# define g_strdup_printf vir_g_strdup_printf
# define g_strdup_vprintf vir_g_strdup_vprintf
#endif
+
+#if !GLIB_CHECK_VERSION(2, 63, 0)
+# define g_fsync vir_g_fsync
+#endif