Preserve errors from fts_* via fts_children by saving errno over
fchdir(2) and close(2).
Details
Details
- Reviewers
jilles imp darius-dons.net.au
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage
Event Timeline
Comment Actions
Don't preserve errno from close(2)
We don't return NULL to the caller on close(2) errors, so they have no reason
to check errno anyway.
lib/libc/gen/fts.c | ||
---|---|---|
574–577 | This should probably be serrno = sp->fts_child == NULL ? errno : 0; since fts_build() may set errno to a non-zero value even if it does not fail (e.g. if symlinks are being followed and there is a dangling symlink (FTS_SLNONE)). |
lib/libc/gen/fts.c | ||
---|---|---|
574–581 | This is maybe now bogus. In particular, the sequence:
|