signal: Define NSIG.
[pspp] / lib / open.c
index f612b802d2185505b2aa19cc72290ab790190cba..4e4493658476a25d28de113108bdddc5ddeea5e3 100644 (file)
@@ -111,7 +111,8 @@ open (const char *filename, int flags, ...)
      override fstat() in fchdir.c to hide the fact that we have a
      dummy.  */
   if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES
-      && (flags & O_ACCMODE) == O_RDONLY)
+      && ((flags & O_ACCMODE) == O_RDONLY
+          || (O_SEARCH != O_RDONLY && (flags & O_ACCMODE) == O_SEARCH)))
     {
       struct stat statbuf;
       if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode))