fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable
[gnulib.git] / lib / openat.c
index f2eac86..9970e46 100644 (file)
@@ -244,7 +244,7 @@ bool
 openat_needs_fchdir (void)
 {
   bool needs_fchdir = true;
-  int fd = open ("/", O_RDONLY);
+  int fd = open ("/", O_SEARCH);
 
   if (0 <= fd)
     {