Page MenuHomeFreeBSD

diff: Correct fd 0 case on pipe
ClosedPublic

Authored by jilles on Sat, May 9, 9:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 4, 12:55 PM
Unknown Object (File)
Thu, Jun 4, 7:19 AM
Unknown Object (File)
Thu, Jun 4, 4:12 AM
Unknown Object (File)
Sun, May 31, 3:11 AM
Unknown Object (File)
Fri, May 29, 7:18 AM
Unknown Object (File)
Thu, May 28, 12:27 PM
Unknown Object (File)
Fri, May 22, 11:38 PM
Unknown Object (File)
Thu, May 21, 3:54 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