From 00bd443d1cd15f4dd7f896447b6b009700de754e Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Mon, 29 May 2023 21:52:50 +0200 Subject: [PATCH] UserspaceEmulator: Prefer FileSystem over DeprecatedFile --- Userland/DevTools/UserspaceEmulator/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Userland/DevTools/UserspaceEmulator/main.cpp b/Userland/DevTools/UserspaceEmulator/main.cpp index 18796d1333..60efb38301 100644 --- a/Userland/DevTools/UserspaceEmulator/main.cpp +++ b/Userland/DevTools/UserspaceEmulator/main.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -43,15 +44,14 @@ int main(int argc, char** argv, char** env) if (dump_profile && profile_instruction_interval == 0) profile_instruction_interval = 128; - DeprecatedString executable_path; - if (arguments[0].contains("/"sv)) - executable_path = Core::DeprecatedFile::real_path_for(arguments[0]); - else - executable_path = Core::DeprecatedFile::resolve_executable_from_environment(arguments[0]).value_or({}); - if (executable_path.is_empty()) { + auto executable_path_or_error = arguments[0].contains('/') + ? FileSystem::real_path(arguments[0]) + : FileSystem::resolve_executable_from_environment(arguments[0]); + if (executable_path_or_error.is_error()) { reportln("Cannot find executable for '{}'."sv, arguments[0]); return 1; } + auto executable_path = executable_path_or_error.release_value().to_deprecated_string(); if (dump_profile && profile_dump_path.is_empty()) profile_dump_path = DeprecatedString::formatted("{}.{}.profile", LexicalPath(executable_path).basename(), getpid());