aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/raw-posix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 985bf69e50..fa4f83e8fc 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -81,7 +81,11 @@
/* OS X does not have O_DSYNC */
#ifndef O_DSYNC
+#ifdef O_SYNC
#define O_DSYNC O_SYNC
+#elif defined(O_FSYNC)
+#define O_DSYNC O_FSYNC
+#endif
#endif
/* Approximate O_DIRECT with O_DSYNC if O_DIRECT isn't available */