1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +00:00

LibFileSystem+Everything: Remove resolve_executable_from_environment

This commit is contained in:
Ben Wiederhake 2023-05-29 22:20:05 +02:00 committed by Jelle Raaijmakers
parent 26efdf9d4f
commit f20d04726a
12 changed files with 12 additions and 23 deletions

View file

@ -121,7 +121,6 @@ target_link_libraries(notify PRIVATE LibGfx LibGUI)
target_link_libraries(open PRIVATE LibDesktop LibFileSystem)
target_link_libraries(passwd PRIVATE LibCrypt)
target_link_libraries(paste PRIVATE LibGUI)
target_link_libraries(pledge PRIVATE LibFileSystem)
target_link_libraries(pgrep PRIVATE LibRegex)
target_link_libraries(pkill PRIVATE LibRegex)
target_link_libraries(pls PRIVATE LibCrypt)
@ -149,7 +148,6 @@ target_link_libraries(usermod PRIVATE LibFileSystem)
target_link_libraries(wallpaper PRIVATE LibGfx LibGUI)
target_link_libraries(wasm PRIVATE LibFileSystem LibJS LibLine LibWasm)
target_link_libraries(watch PRIVATE LibFileSystem)
target_link_libraries(which PRIVATE LibFileSystem)
target_link_libraries(wsctl PRIVATE LibGUI LibIPC)
target_link_libraries(xml PRIVATE LibFileSystem LibXML)
target_link_libraries(xzcat PRIVATE LibCompress)

View file

@ -4,16 +4,16 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/MappedFile.h>
#include <LibCore/System.h>
#include <LibELF/Image.h>
#include <LibFileSystem/FileSystem.h>
#include <LibMain/Main.h>
static ErrorOr<bool> is_dynamically_linked_executable(StringView filename)
{
auto executable = TRY(FileSystem::resolve_executable_from_environment(filename));
auto executable = TRY(Core::System::resolve_executable_from_environment(filename));
auto file = TRY(Core::MappedFile::map(executable));
ELF::Image elf_image(file->bytes());
return elf_image.is_dynamic();

View file

@ -4,9 +4,9 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/String.h>
#include <LibCore/ArgsParser.h>
#include <LibCore/System.h>
#include <LibFileSystem/FileSystem.h>
#include <stdio.h>
#include <unistd.h>
@ -20,7 +20,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(filename, "Name of executable", "executable");
args_parser.parse(arguments);
auto fullpath = FileSystem::resolve_executable_from_environment(filename);
auto fullpath = Core::System::resolve_executable_from_environment(filename);
if (fullpath.is_error()) {
warnln("no '{}' in path", filename);
return 1;