]> git.proxmox.com Git - qemu.git/blobdiff - osdep.c
MAINTAINERS: Document virtex_ml507 machine
[qemu.git] / osdep.c
diff --git a/osdep.c b/osdep.c
index 5b78ceebefe0925db741a99e8cc805b543e235fd..3b25297a25ba046e1a6f2c2608ca852d59650398 100644 (file)
--- a/osdep.c
+++ b/osdep.c
@@ -113,7 +113,13 @@ static int qemu_dup_flags(int fd, int flags)
     }
 
     /* Set/unset flags that we can with fcntl */
-    setfl_flags = O_APPEND | O_ASYNC | O_DIRECT | O_NOATIME | O_NONBLOCK;
+    setfl_flags = O_APPEND | O_ASYNC | O_NONBLOCK;
+#ifdef O_NOATIME
+    setfl_flags |= O_NOATIME;
+#endif
+#ifdef O_DIRECT
+    setfl_flags |= O_DIRECT;
+#endif
     dup_flags &= ~setfl_flags;
     dup_flags |= (flags & setfl_flags);
     if (fcntl(ret, F_SETFL, dup_flags) == -1) {