fts, getcwd, glob: audit for dirfd returning -1
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Sep 2010 16:03:55 +0000 (09:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Sep 2010 16:04:40 +0000 (09:04 -0700)
commit93785052e7a8c1ca5f263a39c3e77286f487e22d
tree49447b046f2eca4a3a55dde6d27829b382c65fbf
parent2ce5b03dcb01f6554b59e19719396803ad34ca01
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.
ChangeLog
lib/fts.c
lib/getcwd.c
lib/glob.c
modules/fts
modules/getcwd