Page MenuHomeFreeBSD

diff: Correct fd 0 case on pipe
ClosedPublic

Authored by jilles on May 9 2026, 9:24 PM.
Tags
None
Referenced Files
F166350665: D56910.id.diff
Thu, Aug 13, 1:42 AM
F166333272: D56910.id179163.diff
Wed, Aug 12, 11:34 PM
Unknown Object (File)
Tue, Aug 11, 9:45 PM
Unknown Object (File)
Mon, Aug 10, 1:08 PM
Unknown Object (File)
Mon, Aug 10, 12:04 PM
Unknown Object (File)
Sun, Aug 9, 2:10 AM
Unknown Object (File)
Sun, Aug 9, 1:10 AM
Unknown Object (File)
Sat, Aug 8, 10:47 AM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 72953
Build 69836: arc lint + arc unit