Bug 200942 - fts_children doesn't preserve errno after running close/fchdir
Summary: fts_children doesn't preserve errno after running close/fchdir
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Jilles Tjoelker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-17 21:58 UTC by Enji Cooper
Modified: 2015-08-09 15:53 UTC (History)
4 users (show)

See Also:
jilles: mfc-stable10+
jilles: mfc-stable9-
jilles: mfc-stable8-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2015-06-17 21:58:36 UTC
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
Comment 1 Conrad Meyer 2015-06-17 22:58:30 UTC
https://reviews.freebsd.org/D2852
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-06-20 20:54:23 UTC
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
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-08-09 15:53:20 UTC
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