Page MenuHomeFreeBSD

diff: Correct fd 0 case on pipe
ClosedPublic

Authored by jilles on May 9 2026, 9:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 5, 5:13 PM
Unknown Object (File)
Thu, Sep 3, 8:26 AM
Unknown Object (File)
Wed, Sep 2, 1:55 AM
Unknown Object (File)
Tue, Sep 1, 5:36 PM
Unknown Object (File)
Tue, Sep 1, 8:22 AM
Unknown Object (File)
Thu, Aug 27, 5:11 PM
Unknown Object (File)
Wed, Aug 26, 7:18 PM
Unknown Object (File)
Sun, Aug 23, 1:05 PM
Subscribers

Details

Summary

After git commit c8d40bf8ecc60cc15e3904410db62065ea681fdc, if fd 0 was
not open, it is left with CLOEXEC set and therefore fails. This is an
unlikely situation, but fixing it reduces the size of the code (by using
posix_spawn_file_actions_adddup2's special case if the two file
descriptor numbers are the same).

At the same time, check the error code from
posix_spawn_file_actions_adddup2.

Diff Detail

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