mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibCore+flock: Make Core::System::waitpid more ergonomic
This commit is contained in:
parent
315e1c705f
commit
0d328f3c86
Notes:
sideshowbarker
2024-07-17 21:11:59 +09:00
Author: https://github.com/juniorrantila
Commit: 0d328f3c86
Pull-request: https://github.com/SerenityOS/serenity/pull/11790
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
3 changed files with 11 additions and 5 deletions
|
@ -517,12 +517,13 @@ ErrorOr<pid_t> posix_spawnp(StringView const path, posix_spawn_file_actions_t* c
|
|||
return child_pid;
|
||||
}
|
||||
|
||||
ErrorOr<pid_t> waitpid(pid_t waitee, int* wstatus, int options)
|
||||
ErrorOr<WaitPidResult> waitpid(pid_t waitee, int options)
|
||||
{
|
||||
pid_t pid = ::waitpid(waitee, wstatus, options);
|
||||
int wstatus;
|
||||
pid_t pid = ::waitpid(waitee, &wstatus, options);
|
||||
if (pid < 0)
|
||||
return Error::from_syscall("waitpid"sv, -errno);
|
||||
return pid;
|
||||
return WaitPidResult { pid, wstatus };
|
||||
}
|
||||
|
||||
ErrorOr<void> setuid(uid_t uid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue