projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* memcoll.c (memcoll): Optimize for the common case where the
[gnulib.git]
/
lib
/
chdir-long.c
diff --git
a/lib/chdir-long.c
b/lib/chdir-long.c
index
2cc70fa
..
8c15d06
100644
(file)
--- a/
lib/chdir-long.c
+++ b/
lib/chdir-long.c
@@
-17,7
+17,9
@@
/* written by Jim Meyering */
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "chdir-long.h"
#include "chdir-long.h"
@@
-75,13
+77,10
@@
cdb_free (struct cd_buf const *cdb)
static int
cdb_advance_fd (struct cd_buf *cdb, char const *dir)
{
static int
cdb_advance_fd (struct cd_buf *cdb, char const *dir)
{
- int new_fd = openat (cdb->fd, dir, O_RDONLY | O_DIRECTORY);
+ int new_fd = openat (cdb->fd, dir,
+ O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
if (new_fd < 0)
if (new_fd < 0)
- {
- new_fd = openat (cdb->fd, dir, O_WRONLY | O_DIRECTORY);
- if (new_fd < 0)
- return -1;
- }
+ return -1;
cdb_free (cdb);
cdb->fd = new_fd;
cdb_free (cdb);
cdb->fd = new_fd;