Page MenuHomeFreeBSD

scandir: Propagate errors from readdir().
ClosedPublic

Authored by des on Jun 25 2025, 8:11 PM.
Tags
None
Referenced Files
F151213799: D51046.diff
Mon, Apr 6, 9:34 PM
F151160789: D51046.id157623.diff
Mon, Apr 6, 12:35 PM
F151155877: D51046.id157651.diff
Mon, Apr 6, 11:48 AM
F151112971: D51046.diff
Mon, Apr 6, 4:06 AM
Unknown Object (File)
Sun, Apr 5, 3:54 PM
Unknown Object (File)
Sun, Apr 5, 5:42 AM
Unknown Object (File)
Sat, Mar 28, 1:17 AM
Unknown Object (File)
Tue, Mar 17, 4:54 PM
Subscribers

Details

Summary

Currently, if readdir() fails, scandir() simply returns a partial
result (or a null result if it fails before any entries were selected).
There is no way within the current API design to return both a partial
result and an error indicator, so err on the side of caution: if an
error occurs, discard any partial result and return the error instead.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Jun 25 2025, 8:11 PM
This revision is now accepted and ready to land.Jun 25 2025, 8:28 PM
This revision now requires review to proceed.Jun 25 2025, 8:43 PM
This revision is now accepted and ready to land.Jun 25 2025, 8:50 PM
This revision was automatically updated to reflect the committed changes.