mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
SystemMenu: Disown spawned programs
This commit is contained in:
parent
7de831efc6
commit
7219f069a5
1 changed files with 6 additions and 1 deletions
|
@ -36,6 +36,7 @@
|
|||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/WindowServerConnection.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <serenity.h>
|
||||
#include <spawn.h>
|
||||
|
||||
//#define SYSTEM_MENU_DEBUG
|
||||
|
@ -163,8 +164,12 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
|
|||
const auto& bin = g_apps[app_identifier].executable;
|
||||
pid_t child_pid;
|
||||
const char* argv[] = { bin.characters(), nullptr };
|
||||
if ((errno = posix_spawn(&child_pid, bin.characters(), nullptr, nullptr, const_cast<char**>(argv), environ)))
|
||||
if ((errno = posix_spawn(&child_pid, bin.characters(), nullptr, nullptr, const_cast<char**>(argv), environ))) {
|
||||
perror("posix_spawn");
|
||||
} else {
|
||||
if (disown(child_pid) < 0)
|
||||
perror("disown");
|
||||
}
|
||||
}));
|
||||
++app_identifier;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue