gfileutils: Use g_fsync() for platform-independence

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2020-05-27 18:51:03 +01:00
parent ea2db92034
commit 84dd89242a

View File

@ -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,