mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-07 08:29:58 +00:00
Clock.MenuApplet: Disown child process after spawning
This commit is contained in:
parent
6e1cb2bae8
commit
9e81b93ab9
|
@ -31,6 +31,7 @@
|
|||
#include <LibGUI/Window.h>
|
||||
#include <LibGfx/Font.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <serenity.h>
|
||||
#include <spawn.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
@ -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<char**>(argv), environ)))
|
||||
if ((errno = posix_spawn(&pid, "/bin/Calendar", nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(pid) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}
|
||||
|
||||
void tick_clock()
|
||||
|
|
Loading…
Reference in a new issue