LaunchServer: Disown child processes after spawning

This commit is contained in:
Andreas Kling 2020-08-04 14:25:41 +02:00
commit cb1fcd3eaf
Notes: sideshowbarker 2024-07-19 04:19:02 +09:00

View file

@ -33,6 +33,7 @@
#include <AK/StringBuilder.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/DirIterator.h>
#include <serenity.h>
#include <spawn.h>
#include <stdio.h>
#include <sys/stat.h>
@ -220,6 +221,9 @@ bool spawn(String executable, String argument)
if ((errno = posix_spawn(&child_pid, executable.characters(), nullptr, nullptr, const_cast<char**>(argv), environ))) {
perror("posix_spawn");
return false;
} else {
if (disown(child_pid) < 0)
perror("disown");
}
return true;
}