mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
glocalfileoutputstream: Use g_fsync() for platform-independence
Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
parent
3b6460b94c
commit
ea2db92034
@ -313,9 +313,8 @@ _g_local_file_output_stream_really_close (GLocalFileOutputStream *file,
|
||||
{
|
||||
GLocalFileStat final_stat;
|
||||
|
||||
#ifdef HAVE_FSYNC
|
||||
if (file->priv->sync_on_close &&
|
||||
fsync (file->priv->fd) != 0)
|
||||
g_fsync (file->priv->fd) != 0)
|
||||
{
|
||||
int errsv = errno;
|
||||
|
||||
@ -325,8 +324,7 @@ _g_local_file_output_stream_really_close (GLocalFileOutputStream *file,
|
||||
g_strerror (errsv));
|
||||
goto err_out;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/* Must close before renaming on Windows, so just do the close first
|
||||
|
Loading…
Reference in New Issue
Block a user