summaryrefslogtreecommitdiff
path: root/Userland/Applications/CrashReporter
diff options
context:
space:
mode:
authorMacDue <macdue@dueutil.tech>2022-05-26 23:28:58 +0100
committerLinus Groh <mail@linusgroh.de>2022-06-03 12:29:56 +0100
commit5fd5a03d1f6ac0d4d0ad29cb01752502fe8ebc0d (patch)
treef6e70c3063932822ac3374da4326d29d40d6f4d5 /Userland/Applications/CrashReporter
parent5e5a055455be0cd8d8784e83e9e80cb4822970ea (diff)
downloadserenity-5fd5a03d1f6ac0d4d0ad29cb01752502fe8ebc0d.zip
Applications: Use spawn_or_show_error() for common spawn pattern
Diffstat (limited to 'Userland/Applications/CrashReporter')
-rw-r--r--Userland/Applications/CrashReporter/main.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/Userland/Applications/CrashReporter/main.cpp b/Userland/Applications/CrashReporter/main.cpp
index 9a956b3970..aca49b9294 100644
--- a/Userland/Applications/CrashReporter/main.cpp
+++ b/Userland/Applications/CrashReporter/main.cpp
@@ -31,6 +31,7 @@
#include <LibGUI/Label.h>
#include <LibGUI/LinkLabel.h>
#include <LibGUI/MessageBox.h>
+#include <LibGUI/Process.h>
#include <LibGUI/Progressbar.h>
#include <LibGUI/TabWidget.h>
#include <LibGUI/TextEditor.h>
@@ -264,14 +265,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto& debug_button = *widget->find_descendant_of_type_named<GUI::Button>("debug_button");
debug_button.set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-hack-studio.png")));
debug_button.on_click = [&](int) {
- pid_t child;
- const char* argv[4] = { "HackStudio", "-c", coredump_path, nullptr };
- if ((errno = posix_spawn(&child, "/bin/HackStudio", nullptr, nullptr, const_cast<char**>(argv), environ))) {
- perror("posix_spawn");
- } else {
- if (disown(child) < 0)
- perror("disown");
- }
+ GUI::Process::spawn_or_show_error(window, "/bin/HackStudio", Array { "-c", coredump_path });
};
auto& save_backtrace_button = *widget->find_descendant_of_type_named<GUI::Button>("save_backtrace_button");