diff --git a/Userland/Applets/ResourceGraph/main.cpp b/Userland/Applets/ResourceGraph/main.cpp index e63a162cbc..c4b0fe526e 100644 --- a/Userland/Applets/ResourceGraph/main.cpp +++ b/Userland/Applets/ResourceGraph/main.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -141,14 +142,7 @@ private: { if (event.button() != GUI::MouseButton::Primary) return; - pid_t child_pid; - char const* argv[] = { "SystemMonitor", "-t", "graphs", nullptr }; - if ((errno = posix_spawn(&child_pid, "/bin/SystemMonitor", nullptr, nullptr, const_cast(argv), environ))) { - perror("posix_spawn"); - } else { - if (disown(child_pid) < 0) - perror("disown"); - } + GUI::Process::spawn_or_show_error(window(), "/bin/SystemMonitor", Array { "-t", m_graph_type == GraphType::Network ? "network" : "graphs" }); } bool get_cpu_usage(u64& total, u64& idle)