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

This commit is contained in:
Andreas Kling 2021-01-23 08:39:59 +01:00
commit c5df0532c0
Notes: sideshowbarker 2024-07-18 22:56:13 +09:00

View file

@ -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();