From f12dc8b7f5a517bc62c5256c3ce79b79dc1a59aa Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 21 May 2023 21:40:39 +0200 Subject: [PATCH] SystemMonitor: Ignore unveil error about unexisting HackStudio binary The minimal build configuration doesn't include HackStudio and SystemMonitor refused to run after trying to unveil a not exiting file. This change will just ignore this specific error for this specific file as if nothing really happened. The ability to quickly debug a process in HackStudio is not the main feature of the application and HackStudio itself is rather heavy to be put in the minimal configuration. Additionally, I find it unnecessary to disable/hide the 'Debug in HackStudio' action because build configurations are mostly for testing purposes anyway. You will get a 'No such file or directory' error in the console after activating the action though. :^) --- Userland/Applications/SystemMonitor/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Applications/SystemMonitor/main.cpp b/Userland/Applications/SystemMonitor/main.cpp index 7c35dfacc6..8fc3d2063a 100644 --- a/Userland/Applications/SystemMonitor/main.cpp +++ b/Userland/Applications/SystemMonitor/main.cpp @@ -265,7 +265,9 @@ ErrorOr serenity_main(Main::Arguments arguments) return result.release_error(); TRY(Core::System::unveil("/bin/Profiler", "rx")); - TRY(Core::System::unveil("/bin/HackStudio", "rx")); + // HackStudio doesn't exist in the minimal build configuration. + if (auto result = Core::System::unveil("/bin/HackStudio", "rx"); result.is_error() && result.error().code() != ENOENT) + return result.release_error(); TRY(Core::System::unveil(nullptr, nullptr)); StringView args_tab = "processes"sv;