Page MenuHomeFreeBSD

forkpty: Avoid fd leak if fork() fails.
ClosedPublic

Authored by des on Aug 17 2023, 1:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 19, 11:30 PM
Unknown Object (File)
Sat, Nov 22, 4:27 PM
Unknown Object (File)
Nov 13 2025, 4:24 AM
Unknown Object (File)
Nov 1 2025, 11:25 PM
Unknown Object (File)
Nov 1 2025, 11:19 PM
Unknown Object (File)
Oct 29 2025, 1:46 PM
Unknown Object (File)
Oct 29 2025, 1:34 PM
Unknown Object (File)
Oct 29 2025, 1:31 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 53151
Build 50042: arc lint + arc unit

Event Timeline

des requested review of this revision.Aug 17 2023, 1:38 PM
allanjude added a subscriber: allanjude.

Reviewed-by: allanjude

This revision is now accepted and ready to land.Aug 17 2023, 1:43 PM
This revision was automatically updated to reflect the committed changes.
markj added inline comments.
lib/libutil/tests/forkpty_test.c
30

This affects all processes with the same UID, right? If so, the setting could cause transient failures for a user running the tests.

Though, contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c does the same thing, and it doesn't appear to cause problems, so perhaps I'm missing something.

des marked an inline comment as done.Aug 17 2023, 2:43 PM
des added inline comments.
lib/libutil/tests/forkpty_test.c
30

The count is global but the limit only applies to the current process and its descendants.

des marked an inline comment as done.Aug 17 2023, 2:43 PM