]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: use g_fsync for portability
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 20 Dec 2019 15:57:24 +0000 (15:57 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 3 Jan 2020 15:42:12 +0000 (15:42 +0000)
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>
src/nwfilter/nwfilter_dhcpsnoop.c
src/storage/storage_util.c
src/util/virfile.c

index 9514dfd75c6149cb06cece68105f07fcbaa8175c..9a71d13d574c949619e65a4a93b6da1c126749f4 100644 (file)
@@ -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);
index f2d8810813f1342e4adf03bfb9e6ae9911645b57..c1a6b44f4b52f2a731306ebb3de821ada4ab3dd0 100644 (file)
@@ -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);
index 0f0d607c595078de497098fedec143d69216182d..1784895575878952d323fd9f6ab53eca12c29502 100644 (file)
@@ -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;