From 4433c9a08282168883feac2391c59430610a18e0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 28 Feb 2003 12:42:31 +0000 Subject: (fts_children): If opening `.' fails, set the fts_child member to NULL before returning. From NetBSD. --- lib/fts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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); -- cgit v1.2.3-70-g09d2