summaryrefslogtreecommitdiff
path: root/lib/getcwd.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-09-14 09:03:55 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2010-09-14 09:04:40 -0700
commit93785052e7a8c1ca5f263a39c3e77286f487e22d (patch)
tree49447b046f2eca4a3a55dde6d27829b382c65fbf /lib/getcwd.c
parent2ce5b03dcb01f6554b59e19719396803ad34ca01 (diff)
downloadgnulib-93785052e7a8c1ca5f263a39c3e77286f487e22d.tar.gz
fts, getcwd, glob: audit for dirfd returning -1
* lib/fts.c (opendir): Remove #define; no longer used. (opendirat): New arg PDIR_FD. All callers changed. (fts_build, _opendir2): Use new opendirat to avoid the need for dirfd, or for checking whether dirfd returns a negative value. Don't use opendir; always use openat followed by fdopendir. * lib/getcwd.c (__getcwd): Don't reset fd; fdopendir no longer clobbers it. * lib/glob.c (link_exists_p): Add comment explaining why dirfd never returns -1 here. * modules/fts (Depends-on): Remove dirfd. * modules/getcwd (Depends-on): Likewise.
Diffstat (limited to 'lib/getcwd.c')
-rw-r--r--lib/getcwd.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/getcwd.c b/lib/getcwd.c
index 7d47072101..26e47f7456 100644
--- a/lib/getcwd.c
+++ b/lib/getcwd.c
@@ -247,8 +247,6 @@ __getcwd (char *buf, size_t size)
dirstream = fdopendir (fd);
if (dirstream == NULL)
goto lose;
- /* Reset fd. It may have been closed by fdopendir. */
- fd = dirfd (dirstream);
fd_needs_closing = false;
#else
dirstream = __opendir (dotlist);