diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-06 16:35:54 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-06 18:56:51 +0200 |
commit | 009ea5013d05799b1840a4283a81bd39304306c7 (patch) | |
tree | 44314bf75fa31718a921061d501ce87f1817b34f /Kernel/Syscalls | |
parent | 511ebffd9420fb7cdc2c67d3c9a0f484dc335033 (diff) | |
download | serenity-009ea5013d05799b1840a4283a81bd39304306c7.zip |
Kernel: Use TRY() in find_elf_interpreter_for_executable()
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r-- | Kernel/Syscalls/execve.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Kernel/Syscalls/execve.cpp b/Kernel/Syscalls/execve.cpp index f6743068b6..a9ae9751bc 100644 --- a/Kernel/Syscalls/execve.cpp +++ b/Kernel/Syscalls/execve.cpp @@ -756,12 +756,7 @@ KResultOr<RefPtr<FileDescription>> Process::find_elf_interpreter_for_executable( if (!interpreter_path.is_empty()) { dbgln_if(EXEC_DEBUG, "exec({}): Using program interpreter {}", path, interpreter_path); - auto interp_result = VirtualFileSystem::the().open(interpreter_path, O_EXEC, 0, current_directory()); - if (interp_result.is_error()) { - dbgln("exec({}): Unable to open program interpreter {}", path, interpreter_path); - return interp_result.error(); - } - auto interpreter_description = interp_result.value(); + auto interpreter_description = TRY(VirtualFileSystem::the().open(interpreter_path, O_EXEC, 0, current_directory())); auto interp_metadata = interpreter_description->metadata(); VERIFY(interpreter_description->inode()); |