mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
SystemMonitor: Disown child processes after spawning
This commit is contained in:
parent
27d3971ba6
commit
256ad7b122
1 changed files with 7 additions and 0 deletions
|
@ -55,6 +55,7 @@
|
|||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <LibPCIDB/Database.h>
|
||||
#include <serenity.h>
|
||||
#include <signal.h>
|
||||
#include <spawn.h>
|
||||
#include <stdio.h>
|
||||
|
@ -222,6 +223,9 @@ int main(int argc, char** argv)
|
|||
const char* argv[] = { "/bin/Profiler", "--pid", pid_string.characters(), nullptr };
|
||||
if ((errno = posix_spawn(&child, "/bin/Profiler", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -235,6 +239,9 @@ int main(int argc, char** argv)
|
|||
const char* argv[] = { "/bin/Inspector", pid_string.characters(), nullptr };
|
||||
if ((errno = posix_spawn(&child, "/bin/Inspector", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue