diff --git a/Services/SystemMenu/main.cpp b/Services/SystemMenu/main.cpp index 8a6ad8aa754..05e0eed0f2b 100644 --- a/Services/SystemMenu/main.cpp +++ b/Services/SystemMenu/main.cpp @@ -215,7 +215,12 @@ NonnullRefPtr build_system_menu() system_menu->add_action(GUI::Action::create("About...", Gfx::Bitmap::load_from_file("/res/icons/16x16/ladybug.png"), [](auto&) { pid_t child_pid; const char* argv[] = { "/bin/About", nullptr }; - posix_spawn(&child_pid, "/bin/About", nullptr, nullptr, const_cast(argv), environ); + if ((errno = posix_spawn(&child_pid, "/bin/About", nullptr, nullptr, const_cast(argv), environ))) { + perror("posix_spawn"); + } else { + if (disown(child_pid) < 0) + perror("disown"); + } })); system_menu->add_separator(); system_menu->add_action(GUI::Action::create("Exit...", Gfx::Bitmap::load_from_file("/res/icons/16x16/power.png"), [](auto&) { @@ -225,7 +230,12 @@ NonnullRefPtr build_system_menu() return; pid_t child_pid; - posix_spawn(&child_pid, command[0], nullptr, nullptr, const_cast(command.data()), environ); + if ((errno = posix_spawn(&child_pid, command[0], nullptr, nullptr, const_cast(command.data()), environ))) { + perror("posix_spawn"); + } else { + if (disown(child_pid) < 0) + perror("disown"); + } })); return system_menu;