mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +00:00
LibCore: Implement System::set_close_on_exec
This commit is contained in:
parent
2e200489c8
commit
2abc792938
Notes:
github-actions[bot]
2025-03-20 02:26:29 +00:00
Author: https://github.com/stasoid
Commit: 2abc792938
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3002
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
8 changed files with 31 additions and 35 deletions
|
@ -193,15 +193,7 @@ ErrorOr<void> PosixSocketHelper::set_blocking(bool enabled)
|
|||
|
||||
ErrorOr<void> PosixSocketHelper::set_close_on_exec(bool enabled)
|
||||
{
|
||||
int flags = TRY(System::fcntl(m_fd, F_GETFD));
|
||||
|
||||
if (enabled)
|
||||
flags |= FD_CLOEXEC;
|
||||
else
|
||||
flags &= ~FD_CLOEXEC;
|
||||
|
||||
TRY(System::fcntl(m_fd, F_SETFD, flags));
|
||||
return {};
|
||||
return System::set_close_on_exec(m_fd, enabled);
|
||||
}
|
||||
|
||||
ErrorOr<void> PosixSocketHelper::set_receive_timeout(AK::Duration timeout)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue