diff options
| author | Don Lewis <truckman@FreeBSD.org> | 2016-05-25 06:55:53 +0000 |
|---|---|---|
| committer | Don Lewis <truckman@FreeBSD.org> | 2016-05-25 06:55:53 +0000 |
| commit | 015f4df218bdc19f28320e7ff55bdb85cf67b8a0 (patch) | |
| tree | 7bc387ee496ac249a3163e14ffe84a798c4c3847 /lib/libc | |
| parent | 8fff7b95fdb525d73a7138ff5ba21f34b7e75004 (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/gen/fts-compat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index cf1daeffded27..c34a281cfe3c5 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -573,8 +573,10 @@ __fts_children_44bsd(FTS *sp, int instr) if ((fd = _open(".", O_RDONLY | O_CLOEXEC, 0)) < 0) return (NULL); sp->fts_child = fts_build(sp, instr); - if (fchdir(fd)) + if (fchdir(fd)) { + (void)_close(fd); return (NULL); + } (void)_close(fd); return (sp->fts_child); } |
