summaryrefslogtreecommitdiff
path: root/Applications/SystemMonitor
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-04 14:23:18 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-04 18:17:16 +0200
commit256ad7b1228acaf3b4653ffb13911e1d3f683c19 (patch)
treee11766cb87af1d5e6554f7444e64d2bee3f53cd2 /Applications/SystemMonitor
parent27d3971ba6d5be40a45e1d8932f0a30d66035cb9 (diff)
downloadserenity-256ad7b1228acaf3b4653ffb13911e1d3f683c19.zip
SystemMonitor: Disown child processes after spawning
Diffstat (limited to 'Applications/SystemMonitor')
-rw-r--r--Applications/SystemMonitor/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp
index 1525e575ec..f644477927 100644
--- a/Applications/SystemMonitor/main.cpp
+++ b/Applications/SystemMonitor/main.cpp
@@ -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");
}
}
});