From 1f475f7bbcc816e91f54d72b003b2d10b91bbef8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 17:59:38 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$realpath() --- Kernel/Syscalls/realpath.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Kernel/Syscalls/realpath.cpp b/Kernel/Syscalls/realpath.cpp index 4262c4adef..bbb44e026c 100644 --- a/Kernel/Syscalls/realpath.cpp +++ b/Kernel/Syscalls/realpath.cpp @@ -17,14 +17,9 @@ KResultOr Process::sys$realpath(Userspaceview(), current_directory())); - auto custody_or_error = VirtualFileSystem::the().resolve_path(path.value()->view(), current_directory()); - if (custody_or_error.is_error()) - return custody_or_error.error(); - auto& custody = custody_or_error.value(); auto absolute_path = custody->try_create_absolute_path(); if (!absolute_path) return ENOMEM;