summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2023-05-12 23:53:44 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-15 06:50:43 +0200
commit85c897dc17e8f1f373e1d663366a57dec63d0d79 (patch)
tree0ac3bd6a0031b4d8115f7aeca17e4d561261ca32
parente77f59b7d38e64faa5acd990b0daa81a935c1588 (diff)
downloadserenity-85c897dc17e8f1f373e1d663366a57dec63d0d79.zip
LaunchServer: Prefer FileSystem over DeprecatedFile
-rw-r--r--Userland/Services/LaunchServer/CMakeLists.txt2
-rw-r--r--Userland/Services/LaunchServer/Launcher.cpp16
2 files changed, 12 insertions, 6 deletions
diff --git a/Userland/Services/LaunchServer/CMakeLists.txt b/Userland/Services/LaunchServer/CMakeLists.txt
index e6f49231af..f97bca1175 100644
--- a/Userland/Services/LaunchServer/CMakeLists.txt
+++ b/Userland/Services/LaunchServer/CMakeLists.txt
@@ -19,4 +19,4 @@ set(GENERATED_SOURCES
)
serenity_bin(LaunchServer)
-target_link_libraries(LaunchServer PRIVATE LibCore LibIPC LibDesktop LibMain)
+target_link_libraries(LaunchServer PRIVATE LibCore LibIPC LibDesktop LibFileSystem LibMain)
diff --git a/Userland/Services/LaunchServer/Launcher.cpp b/Userland/Services/LaunchServer/Launcher.cpp
index b77341ae3c..87dd2b33f3 100644
--- a/Userland/Services/LaunchServer/Launcher.cpp
+++ b/Userland/Services/LaunchServer/Launcher.cpp
@@ -12,10 +12,10 @@
#include <AK/LexicalPath.h>
#include <AK/StringBuilder.h>
#include <LibCore/ConfigFile.h>
-#include <LibCore/DeprecatedFile.h>
#include <LibCore/MimeData.h>
#include <LibCore/Process.h>
#include <LibDesktop/AppFile.h>
+#include <LibFileSystem/FileSystem.h>
#include <errno.h>
#include <serenity.h>
#include <spawn.h>
@@ -303,16 +303,22 @@ void Launcher::for_each_handler_for_path(DeprecatedString const& path, Function<
return;
if (S_ISLNK(st.st_mode)) {
- auto link_target_or_error = Core::DeprecatedFile::read_link(path);
+ auto link_target_or_error = FileSystem::read_link(path);
if (link_target_or_error.is_error()) {
perror("read_link");
return;
}
- auto link_target = LexicalPath { link_target_or_error.release_value() };
+ auto link_target = LexicalPath { link_target_or_error.release_value().to_deprecated_string() };
LexicalPath absolute_link_target = link_target.is_absolute() ? link_target : LexicalPath::join(LexicalPath::dirname(path), link_target.string());
- auto real_path = Core::DeprecatedFile::real_path_for(absolute_link_target.string());
- return for_each_handler_for_path(real_path, [&](auto const& handler) -> bool {
+ auto real_path_or_error = FileSystem::real_path(absolute_link_target.string());
+ if (real_path_or_error.is_error()) {
+ perror("real_path");
+ return;
+ }
+ auto real_path = real_path_or_error.release_value();
+
+ return for_each_handler_for_path(real_path.to_deprecated_string(), [&](auto const& handler) -> bool {
return f(handler);
});
}