HomeFreeBSD

scandir: Propagate errors from readdir().

Description

scandir: Propagate errors from readdir().

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
Reported by: Maxim Suhanov <dfirblog@gmail.com>
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51046

Details

Provenance
desAuthored on Jun 26 2025, 7:37 AM
Reviewer
markj
Differential Revision
D51046: scandir: Propagate errors from readdir().
Parents
rGdba00b1c6bc1: nuageinit: launch post network script with postnet citype
Branches
Unknown
Tags
Unknown