Noticed in an internal code review -- in particular mjohnston noted that fts_open doesn't preserve the errno after close/fchdir is called and Conrad Meyer confirmed it: https://svnweb.freebsd.org/base/head/lib/libc/gen/fts.c?view=annotate#l571 This might be the root cause behind a handful of other bugs with rm related to fts_open, etc. Spotted by: mjohnston In collaboration with: Conrad Meyer
https://reviews.freebsd.org/D2852
A commit references this bug: Author: jilles Date: Sat Jun 20 20:54:05 UTC 2015 New revision: 284649 URL: https://svnweb.freebsd.org/changeset/base/284649 Log: fts_children: preserve errno after running close/fchdir PR: 200942 Submitted by: Conrad Meyer Differential Revision: https://reviews.freebsd.org/D2852 MFC after: 1 week Changes: head/lib/libc/gen/fts.c
A commit references this bug: Author: jilles Date: Sun Aug 9 15:53:03 UTC 2015 New revision: 286534 URL: https://svnweb.freebsd.org/changeset/base/286534 Log: MFC r284649: fts_children: preserve errno after running close/fchdir PR: 200942 Submitted by: Conrad Meyer Changes: _U stable/10/ stable/10/lib/libc/gen/fts.c