mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibCore: Add a Core::Process action to close a file after spawning
This commit is contained in:
committed by
Andrew Kaster
parent
fecd08ce64
commit
dc52404aec
@@ -90,6 +90,10 @@ ErrorOr<Process> Process::spawn(ProcessSpawnOptions const& options)
|
||||
File::open_mode_to_options(action.mode | Core::File::OpenMode::KeepOnExec),
|
||||
action.permissions));
|
||||
return {};
|
||||
},
|
||||
[&](FileAction::CloseFile const& action) -> ErrorOr<void> {
|
||||
CHECK(posix_spawn_file_actions_addclose(&spawn_actions, action.fd));
|
||||
return {};
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user