mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:27:35 +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/ArgsParser.h>
|
||||||
#include <LibCore/DirIterator.h>
|
#include <LibCore/DirIterator.h>
|
||||||
#include <LibCore/Process.h>
|
#include <LibCore/Process.h>
|
||||||
|
#include <LibFileSystem/FileSystem.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <serenity.h>
|
#include <serenity.h>
|
||||||
|
@ -43,15 +44,14 @@ int main(int argc, char** argv, char** env)
|
||||||
if (dump_profile && profile_instruction_interval == 0)
|
if (dump_profile && profile_instruction_interval == 0)
|
||||||
profile_instruction_interval = 128;
|
profile_instruction_interval = 128;
|
||||||
|
|
||||||
DeprecatedString executable_path;
|
auto executable_path_or_error = arguments[0].contains('/')
|
||||||
if (arguments[0].contains("/"sv))
|
? FileSystem::real_path(arguments[0])
|
||||||
executable_path = Core::DeprecatedFile::real_path_for(arguments[0]);
|
: FileSystem::resolve_executable_from_environment(arguments[0]);
|
||||||
else
|
if (executable_path_or_error.is_error()) {
|
||||||
executable_path = Core::DeprecatedFile::resolve_executable_from_environment(arguments[0]).value_or({});
|
|
||||||
if (executable_path.is_empty()) {
|
|
||||||
reportln("Cannot find executable for '{}'."sv, arguments[0]);
|
reportln("Cannot find executable for '{}'."sv, arguments[0]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
auto executable_path = executable_path_or_error.release_value().to_deprecated_string();
|
||||||
|
|
||||||
if (dump_profile && profile_dump_path.is_empty())
|
if (dump_profile && profile_dump_path.is_empty())
|
||||||
profile_dump_path = DeprecatedString::formatted("{}.{}.profile", LexicalPath(executable_path).basename(), getpid());
|
profile_dump_path = DeprecatedString::formatted("{}.{}.profile", LexicalPath(executable_path).basename(), getpid());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue