diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2020-01-15 14:05:49 +0300 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 21:49:58 +0100 |
commit | 064cd2278cda21622ffae69a7263581d72fd09a6 (patch) | |
tree | ef2357322d9c587c7001f955f7bcd80f4a69d319 /Kernel/Process.cpp | |
parent | 68aeefa49bdc0a76ecb91e9e06d33a9b106d7c41 (diff) | |
download | serenity-064cd2278cda21622ffae69a7263581d72fd09a6.zip |
Kernel: Remove the use of FileSystemPath in sys$realpath()
Now that VFS::resolve_path() canonicalizes paths automatically, we don't need to
do that here anymore.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index ff8522e75a..d2d5ca7745 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -2578,18 +2578,12 @@ int Process::sys$realpath(const Syscall::SC_realpath_params* user_params) if (custody_or_error.is_error()) return custody_or_error.error(); auto& custody = custody_or_error.value(); + auto absolute_path = custody->absolute_path(); - // FIXME: Once resolve_path is fixed to deal with .. and . , remove the use of FileSystemPath::canonical_path. - FileSystemPath canonical_path(custody->absolute_path()); - if (!canonical_path.is_valid()) { - dbg() << "FileSystemPath failed to canonicalize " << custody->absolute_path(); - ASSERT_NOT_REACHED(); - } - - if (canonical_path.string().length() + 1 > params.buffer.size) + if (absolute_path.length() + 1 > params.buffer.size) return -ENAMETOOLONG; - copy_to_user(params.buffer.data, canonical_path.string().characters(), canonical_path.string().length() + 1); + copy_to_user(params.buffer.data, absolute_path.characters(), absolute_path.length() + 1); return 0; }; |