Commit 84dd8924 authored by Philip Withnall's avatar Philip Withnall

gfileutils: Use g_fsync() for platform-independence

Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
parent ea2db920
...@@ -1066,7 +1066,7 @@ rename_file (const char *old_name, ...@@ -1066,7 +1066,7 @@ rename_file (const char *old_name,
if (dir_fd >= 0) if (dir_fd >= 0)
{ {
fsync (dir_fd); g_fsync (dir_fd);
g_close (dir_fd, NULL); g_close (dir_fd, NULL);
} }
...@@ -1182,7 +1182,7 @@ write_to_file (const gchar *contents, ...@@ -1182,7 +1182,7 @@ write_to_file (const gchar *contents,
#ifdef HAVE_FSYNC #ifdef HAVE_FSYNC
errno = 0; errno = 0;
if (do_fsync && fsync (fd) != 0) if (do_fsync && g_fsync (fd) != 0)
{ {
int saved_errno = errno; int saved_errno = errno;
set_file_error (err, set_file_error (err,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment