From 84dd89242ae8d482061a5370936c9447d0a939fa Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 27 May 2020 18:51:03 +0100 Subject: [PATCH] gfileutils: Use g_fsync() for platform-independence Signed-off-by: Philip Withnall --- glib/gfileutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glib/gfileutils.c b/glib/gfileutils.c index 99108fac6..8d80cd50a 100644 --- a/glib/gfileutils.c +++ b/glib/gfileutils.c @@ -1066,7 +1066,7 @@ rename_file (const char *old_name, if (dir_fd >= 0) { - fsync (dir_fd); + g_fsync (dir_fd); g_close (dir_fd, NULL); } @@ -1182,7 +1182,7 @@ write_to_file (const gchar *contents, #ifdef HAVE_FSYNC errno = 0; - if (do_fsync && fsync (fd) != 0) + if (do_fsync && g_fsync (fd) != 0) { int saved_errno = errno; set_file_error (err,