提交 dac174ee 编写于 作者: D Daniel P. Berrangé

src: use g_fsync for portability

The g_fsync() API provides the same Windows portability
as GNULIB does for fsync().
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 41d9bba5
......@@ -1772,7 +1772,7 @@ virNWFilterSnoopLeaseFileWrite(int lfd, const char *ifkey,
goto cleanup;
}
ignore_value(fsync(lfd));
ignore_value(g_fsync(lfd));
cleanup:
VIR_FREE(lbuf);
......
......@@ -384,7 +384,7 @@ createRawFile(int fd, virStorageVolDefPtr vol,
}
}
if (fsync(fd) < 0) {
if (g_fsync(fd) < 0) {
ret = -errno;
virReportSystemError(errno, _("cannot sync data to file '%s'"),
vol->target.path);
......
......@@ -519,7 +519,7 @@ virFileRewrite(const char *path,
goto cleanup;
}
if (fsync(fd) < 0) {
if (g_fsync(fd) < 0) {
virReportSystemError(errno, _("cannot sync file '%s'"),
newfile);
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册