Page MenuHomeFreeBSD

scandir: Propagate errors from readdir().
ClosedPublic

Authored by des on Wed, Jun 25, 8:11 PM.
Tags
None
Referenced Files
F122191451: D51046.id157623.diff
Thu, Jul 3, 4:09 AM
Unknown Object (File)
Wed, Jul 2, 7:39 AM
Unknown Object (File)
Wed, Jul 2, 5:09 AM
Unknown Object (File)
Wed, Jul 2, 4:37 AM
Unknown Object (File)
Sun, Jun 29, 5:28 PM
Unknown Object (File)
Sat, Jun 28, 3:28 PM
Unknown Object (File)
Thu, Jun 26, 7:38 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 65087
Build 61970: arc lint + arc unit