From 0a7041aad7f9b60004a2776dfda8b65a3f9d6667 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sat, 7 Aug 2021 00:48:08 +0200 Subject: [PATCH] Taskbar: Pass full argv for exit action We need to pass --now to `shutdown` command. --- Userland/Services/Taskbar/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp index f76ac5f2db..ff6c62eb1e 100644 --- a/Userland/Services/Taskbar/main.cpp +++ b/Userland/Services/Taskbar/main.cpp @@ -273,7 +273,13 @@ NonnullRefPtr build_system_menu() if (command.size() == 0) return; - Core::Process::spawn(command[0]); + pid_t child_pid; + 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;