mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
src: use g_fsync for portability
The g_fsync() API provides the same Windows portability as GNULIB does for fsync(). Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
41d9bba57e
commit
dac174ee07
@ -1772,7 +1772,7 @@ virNWFilterSnoopLeaseFileWrite(int lfd, const char *ifkey,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore_value(fsync(lfd));
|
ignore_value(g_fsync(lfd));
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(lbuf);
|
VIR_FREE(lbuf);
|
||||||
|
@ -384,7 +384,7 @@ createRawFile(int fd, virStorageVolDefPtr vol,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fsync(fd) < 0) {
|
if (g_fsync(fd) < 0) {
|
||||||
ret = -errno;
|
ret = -errno;
|
||||||
virReportSystemError(errno, _("cannot sync data to file '%s'"),
|
virReportSystemError(errno, _("cannot sync data to file '%s'"),
|
||||||
vol->target.path);
|
vol->target.path);
|
||||||
|
@ -519,7 +519,7 @@ virFileRewrite(const char *path,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fsync(fd) < 0) {
|
if (g_fsync(fd) < 0) {
|
||||||
virReportSystemError(errno, _("cannot sync file '%s'"),
|
virReportSystemError(errno, _("cannot sync file '%s'"),
|
||||||
newfile);
|
newfile);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user