From: Martin Mares Date: Fri, 22 Apr 2005 13:17:07 +0000 (+0000) Subject: Don't use O_DIRECTORY on non-Linux systems. (It's not necessary, but it X-Git-Tag: holmes-import~785 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=294069b36bce29e484a446222229cb870b0e763a;p=libucw.git Don't use O_DIRECTORY on non-Linux systems. (It's not necessary, but it adds an extra check.) --- diff --git a/lib/sync.c b/lib/sync.c index 8877e310..1b3a0d15 100644 --- a/lib/sync.c +++ b/lib/sync.c @@ -1,7 +1,7 @@ /* * UCW Library -- Syncing Directories * - * (c) 2004 Martin Mares + * (c) 2004--2005 Martin Mares */ #include "lib/lib.h" @@ -12,7 +12,11 @@ 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);