mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibCore: Check for fork() failure
For those good boy points :^)
This commit is contained in:
parent
f8b2a7b4a7
commit
50c139e61c
Notes:
sideshowbarker
2024-07-19 07:29:01 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/50c139e61c8 Pull-request: https://github.com/SerenityOS/serenity/pull/1866
1 changed files with 6 additions and 1 deletions
|
@ -44,7 +44,12 @@ bool DesktopServices::open(const URL& url)
|
|||
|
||||
bool spawn(String executable, String argument)
|
||||
{
|
||||
if (fork() == 0) {
|
||||
pid_t child_pid = fork();
|
||||
if (child_pid < 0) {
|
||||
perror("fork");
|
||||
return false;
|
||||
}
|
||||
if (child_pid == 0) {
|
||||
if (execl(executable.characters(), executable.characters(), argument.characters(), nullptr) < 0) {
|
||||
perror("execl");
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue