Page MenuHomeFreeBSD

scandir: Propagate errors from readdir().
ClosedPublic

Authored by des on Jun 25 2025, 8:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 1, 12:55 AM
Unknown Object (File)
Wed, Sep 24, 2:58 AM
Unknown Object (File)
Thu, Sep 18, 8:56 PM
Unknown Object (File)
Thu, Sep 18, 3:23 AM
Unknown Object (File)
Wed, Sep 17, 7:01 AM
Unknown Object (File)
Tue, Sep 16, 1:37 PM
Unknown Object (File)
Sat, Sep 13, 8:36 PM
Unknown Object (File)
Sep 2 2025, 11:02 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 Not Applicable
Unit
Tests Not Applicable