mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:48:11 +00:00
LibCore: Check for fork() failure
For those good boy points :^)
This commit is contained in:
parent
f8b2a7b4a7
commit
50c139e61c
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…
Add table
Add a link
Reference in a new issue