[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 1/3] build: storage: fdatasync() is not supported in Mac OS X.



This patch changes fdatasync() to fsync() to compile cleanly in OS X.
---
 src/storage/storage_backend.c |    2 +-
 src/storage/storage_driver.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index d125504..ee39836 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -208,7 +208,7 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
         } while ((amtleft -= interval) > 0);
     }

-    if (fdatasync(fd) < 0) {
+    if (fsync(fd) < 0) {
         ret = -errno;
         virReportSystemError(errno, _("cannot sync data to file '%s'"),
                              vol->target.path);
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index c05b74e..aea4c71 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1783,7 +1783,7 @@ storageWipeExtent(virStorageVolDefPtr vol,
         remaining -= written;
     }

-    if (fdatasync(fd) < 0) {
+    if (fsync(fd) < 0) {
         ret = -errno;
         virReportSystemError(errno,
                              _("cannot sync data to volume with path '%s'"),
-- 
1.7.3.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]