mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
pledge: Prefer FileSystem over DeprecatedFile
This commit is contained in:
parent
8c2cdb7bc7
commit
77f021f5f1
Notes:
sideshowbarker
2024-07-17 06:29:49 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/77f021f5f1 Pull-request: https://github.com/SerenityOS/serenity/pull/18801
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(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)
|
||||
|
|
|
@ -5,20 +5,16 @@
|
|||
*/
|
||||
|
||||
#include <LibCore/ArgsParser.h>
|
||||
#include <LibCore/DeprecatedFile.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 maybe_executable = Core::DeprecatedFile::resolve_executable_from_environment(filename);
|
||||
|
||||
if (!maybe_executable.has_value())
|
||||
return ENOENT;
|
||||
|
||||
auto file = TRY(Core::MappedFile::map(maybe_executable.release_value()));
|
||||
auto executable = TRY(FileSystem::resolve_executable_from_environment(filename));
|
||||
auto file = TRY(Core::MappedFile::map(executable));
|
||||
ELF::Image elf_image(file->bytes());
|
||||
return elf_image.is_dynamic();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue