mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 14:47:34 +00:00
Userland: Use find_executable_in_path in UserspaceEmulator.
This commit is contained in:
parent
c577f6e139
commit
f1b1a78f26
1 changed files with 3 additions and 4 deletions
|
@ -30,7 +30,7 @@
|
||||||
#include <AK/LogStream.h>
|
#include <AK/LogStream.h>
|
||||||
#include <AK/MappedFile.h>
|
#include <AK/MappedFile.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/DirIterator.h>
|
||||||
#include <LibELF/Loader.h>
|
#include <LibELF/Loader.h>
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
@ -39,12 +39,11 @@
|
||||||
int main(int argc, char** argv, char** env)
|
int main(int argc, char** argv, char** env)
|
||||||
{
|
{
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
out() << "usage: UserspaceEmulator <command>";
|
out() << "Usage: UserspaceEmulator <command>";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Allow specifying any command in $PATH instead of requiring a full executable path.
|
auto executable_path = Core::find_executable_in_path(argv[1]);
|
||||||
const char* executable_path = argv[1];
|
|
||||||
|
|
||||||
MappedFile mapped_file(executable_path);
|
MappedFile mapped_file(executable_path);
|
||||||
if (!mapped_file.is_valid()) {
|
if (!mapped_file.is_valid()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue