mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
pledge: Prefer FileSystem over DeprecatedFile
This commit is contained in:
parent
8c2cdb7bc7
commit
77f021f5f1
2 changed files with 4 additions and 7 deletions
|
@ -119,6 +119,7 @@ target_link_libraries(notify PRIVATE LibGfx LibGUI)
|
||||||
target_link_libraries(open PRIVATE LibDesktop)
|
target_link_libraries(open PRIVATE LibDesktop)
|
||||||
target_link_libraries(passwd PRIVATE LibCrypt)
|
target_link_libraries(passwd PRIVATE LibCrypt)
|
||||||
target_link_libraries(paste PRIVATE LibGUI)
|
target_link_libraries(paste PRIVATE LibGUI)
|
||||||
|
target_link_libraries(pledge PRIVATE LibFileSystem)
|
||||||
target_link_libraries(pgrep PRIVATE LibRegex)
|
target_link_libraries(pgrep PRIVATE LibRegex)
|
||||||
target_link_libraries(pkill PRIVATE LibRegex)
|
target_link_libraries(pkill PRIVATE LibRegex)
|
||||||
target_link_libraries(pls PRIVATE LibCrypt)
|
target_link_libraries(pls PRIVATE LibCrypt)
|
||||||
|
|
|
@ -5,20 +5,16 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibCore/ArgsParser.h>
|
#include <LibCore/ArgsParser.h>
|
||||||
#include <LibCore/DeprecatedFile.h>
|
|
||||||
#include <LibCore/MappedFile.h>
|
#include <LibCore/MappedFile.h>
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
#include <LibELF/Image.h>
|
#include <LibELF/Image.h>
|
||||||
|
#include <LibFileSystem/FileSystem.h>
|
||||||
#include <LibMain/Main.h>
|
#include <LibMain/Main.h>
|
||||||
|
|
||||||
static ErrorOr<bool> is_dynamically_linked_executable(StringView filename)
|
static ErrorOr<bool> is_dynamically_linked_executable(StringView filename)
|
||||||
{
|
{
|
||||||
auto maybe_executable = Core::DeprecatedFile::resolve_executable_from_environment(filename);
|
auto executable = TRY(FileSystem::resolve_executable_from_environment(filename));
|
||||||
|
auto file = TRY(Core::MappedFile::map(executable));
|
||||||
if (!maybe_executable.has_value())
|
|
||||||
return ENOENT;
|
|
||||||
|
|
||||||
auto file = TRY(Core::MappedFile::map(maybe_executable.release_value()));
|
|
||||||
ELF::Image elf_image(file->bytes());
|
ELF::Image elf_image(file->bytes());
|
||||||
return elf_image.is_dynamic();
|
return elf_image.is_dynamic();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue