mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
UserspaceEmulator: Prefer FileSystem over DeprecatedFile
This commit is contained in:
parent
eabadf9e02
commit
00bd443d1c
1 changed files with 6 additions and 6 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
#include <LibCore/Process.h>
|
||||
#include <LibFileSystem/FileSystem.h>
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
#include <serenity.h>
|
||||
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue