]> mj.ucw.cz Git - libucw.git/commitdiff
Don't use O_DIRECTORY on non-Linux systems. (It's not necessary, but it
authorMartin Mares <mj@ucw.cz>
Fri, 22 Apr 2005 13:17:07 +0000 (13:17 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 22 Apr 2005 13:17:07 +0000 (13:17 +0000)
adds an extra check.)

lib/sync.c

index 8877e31072dc4582840703349a961bf0e6707ff0..1b3a0d1571f5f043aa246ac89a2efb2f0af85991 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Syncing Directories
  *
- *     (c) 2004 Martin Mares <mj@ucw.cz>
+ *     (c) 2004--2005 Martin Mares <mj@ucw.cz>
  */
 
 #include "lib/lib.h"
 void
 sync_dir(byte *name)
 {
-  int fd = open(name, O_RDONLY | O_DIRECTORY);
+  int fd = open(name, O_RDONLY
+#ifdef CONFIG_LINUX
+               | O_DIRECTORY
+#endif
+);
   if (fd < 0)
     goto err;
   int err = fsync(fd);