1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03: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:
Daniel P. Berrangé 2019-12-20 15:57:24 +00:00
parent 41d9bba57e
commit dac174ee07
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

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