aboutsummaryrefslogtreecommitdiff
path: root/block/raw-posix.c
diff options
context:
space:
mode:
authorG 3 <programmingkidx@gmail.com>2009-07-01 13:28:32 -0400
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-09 16:58:07 -0500
commit1c27a8b35ed2736a0542983facbe861d44785a44 (patch)
tree4d4b0b31572b16587cf64577379641126860ac7c /block/raw-posix.c
parentc76f4952bbf47116255bc00780ceae3bc8a657c0 (diff)
Substitute O_DSYNC with O_SYNC or O_FSYNC when needed.
Signed-off-by: John Arbuckle <programmingkidx@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block/raw-posix.c')
-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 */