Browse Source

HackStudio: Handle failed fork() in TerminalWrapper a bit better

Andreas Kling 4 years ago
parent
commit
c5df0532c0
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Userland/DevTools/HackStudio/TerminalWrapper.cpp

+ 5 - 0
Userland/DevTools/HackStudio/TerminalWrapper.cpp

@@ -88,6 +88,11 @@ void TerminalWrapper::run_command(const String& command)
     };
     };
 
 
     m_pid = fork();
     m_pid = fork();
+    if (m_pid < 0) {
+        perror("fork");
+        return;
+    }
+
     if (m_pid == 0) {
     if (m_pid == 0) {
         // Create a new process group.
         // Create a new process group.
         setsid();
         setsid();