summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-02-28 12:42:31 +0000
committerJim Meyering <jim@meyering.net>2003-02-28 12:42:31 +0000
commit4433c9a08282168883feac2391c59430610a18e0 (patch)
tree6b319ee4d00260a990c41f909b490a6b16deb3f8 /lib
parent3a4ac3a6a6b8ddb81752056cfb5fa8ca31da812e (diff)
downloadcoreutils-4433c9a08282168883feac2391c59430610a18e0.tar.xz
(fts_children): If opening `.' fails, set the fts_child
member to NULL before returning. From NetBSD.
Diffstat (limited to 'lib')
-rw-r--r--lib/fts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fts.c b/lib/fts.c
index 439826cfd..69e52ded4 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -670,7 +670,7 @@ fts_children(sp, instr)
return (sp->fts_child = fts_build(sp, instr));
if ((fd = open(".", O_RDONLY, 0)) < 0)
- return (NULL);
+ return (sp->fts_child = NULL);
sp->fts_child = fts_build(sp, instr);
if (fchdir(fd)) {
(void)close(fd);