mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibCore/Process: Add DupFd
file action
This commit provides a new file action allowing callers to provide a `write_fd` that Process will "redirect" the child's stdin/stdout to.
This commit is contained in:
parent
cddbe7d10f
commit
aa4dcca0b2
Notes:
github-actions[bot]
2024-12-06 00:09:34 +00:00
Author: https://github.com/rmg-x
Commit: aa4dcca0b2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2553
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/shannonbooth
2 changed files with 9 additions and 3 deletions
|
@ -121,6 +121,10 @@ ErrorOr<Process> Process::spawn(ProcessSpawnOptions const& options)
|
|||
[&](FileAction::CloseFile const& action) -> ErrorOr<void> {
|
||||
CHECK(posix_spawn_file_actions_addclose(&spawn_actions, action.fd));
|
||||
return {};
|
||||
},
|
||||
[&](FileAction::DupFd const& action) -> ErrorOr<void> {
|
||||
CHECK(posix_spawn_file_actions_adddup2(&spawn_actions, action.write_fd, action.fd));
|
||||
return {};
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue