summaryrefslogtreecommitdiff
path: root/Libraries/LibCore/DesktopServices.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibCore/DesktopServices.cpp')
-rw-r--r--Libraries/LibCore/DesktopServices.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibCore/DesktopServices.cpp b/Libraries/LibCore/DesktopServices.cpp
index 393fee2ee2..5fb396593f 100644
--- a/Libraries/LibCore/DesktopServices.cpp
+++ b/Libraries/LibCore/DesktopServices.cpp
@@ -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;