From 9e81b93ab9713ed5dee5c7f298056550ed0cb4fc Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 4 Aug 2020 14:25:03 +0200 Subject: [PATCH] Clock.MenuApplet: Disown child process after spawning --- MenuApplets/Clock/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/MenuApplets/Clock/main.cpp b/MenuApplets/Clock/main.cpp index 3eea5c09db7..a85cee62791 100644 --- a/MenuApplets/Clock/main.cpp +++ b/MenuApplets/Clock/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +53,7 @@ public: }); } - virtual ~ClockWidget() override {} + virtual ~ClockWidget() override { } int get_width() { @@ -87,8 +88,12 @@ private: pid_t pid; const char* argv[] = { "Calendar", nullptr }; - if ((errno = posix_spawn(&pid, "/bin/Calendar", nullptr, nullptr, const_cast(argv), environ))) + if ((errno = posix_spawn(&pid, "/bin/Calendar", nullptr, nullptr, const_cast(argv), environ))) { perror("posix_spawn"); + } else { + if (disown(pid) < 0) + perror("disown"); + } } void tick_clock()