projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fts, getcwd, glob: audit for dirfd returning -1
[pspp]
/
lib
/
glob.c
diff --git
a/lib/glob.c
b/lib/glob.c
index 03b55df28da1356b72fd97407f87c83b09b5933a..5be8c321174a61d74b39c27b744995c092b2227c 100644
(file)
--- a/
lib/glob.c
+++ b/
lib/glob.c
@@
-1282,6
+1282,8
@@
link_exists_p (int dfd, const char *dir, size_t dirlen, const char *fname,
return link_exists2_p (dir, dirlen, fname, pglob);
else
{
+ /* dfd cannot be -1 here, because dirfd never returns -1 on
+ glibc, or on hosts that have fstatat. */
struct_stat64 st64;
return __fxstatat64 (_STAT_VER, dfd, fname, &st64, 0) == 0;
}