瀏覽代碼

Taskbar: Pass full argv for exit action

We need to pass --now to `shutdown` command.
LuK1337 3 年之前
父節點
當前提交
0a7041aad7
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      Userland/Services/Taskbar/main.cpp

+ 7 - 1
Userland/Services/Taskbar/main.cpp

@@ -273,7 +273,13 @@ NonnullRefPtr<GUI::Menu> build_system_menu()
         if (command.size() == 0)
         if (command.size() == 0)
             return;
             return;
 
 
-        Core::Process::spawn(command[0]);
+        pid_t child_pid;
+        if ((errno = posix_spawn(&child_pid, command[0], nullptr, nullptr, const_cast<char**>(command.data()), environ))) {
+            perror("posix_spawn");
+        } else {
+            if (disown(child_pid) < 0)
+                perror("disown");
+        }
     }));
     }));
 
 
     return system_menu;
     return system_menu;