Page MenuHomeFreeBSD

scandir: Propagate errors from readdir().
ClosedPublic

Authored by des on Jun 25 2025, 8:11 PM.
Tags
None
Referenced Files
F139356185: D51046.id157618.diff
Thu, Dec 11, 4:15 AM
Unknown Object (File)
Wed, Nov 26, 5:23 PM
Unknown Object (File)
Nov 7 2025, 10:40 PM
Unknown Object (File)
Nov 4 2025, 4:47 AM
Unknown Object (File)
Nov 4 2025, 4:47 AM
Unknown Object (File)
Nov 4 2025, 4:47 AM
Unknown Object (File)
Nov 4 2025, 4:47 AM
Unknown Object (File)
Nov 4 2025, 4:46 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 65091
Build 61974: arc lint + arc unit