From afc5bbd56bac1e055ad892262578a0150311c535 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 18:10:27 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$write() --- Kernel/Syscalls/write.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Kernel/Syscalls/write.cpp b/Kernel/Syscalls/write.cpp index b23600166a..4329666d3c 100644 --- a/Kernel/Syscalls/write.cpp +++ b/Kernel/Syscalls/write.cpp @@ -62,9 +62,7 @@ KResultOr Process::do_write(FileDescription& description, const UserOrK size_t total_nwritten = 0; if (description.should_append() && description.file().is_seekable()) { - auto seek_result = description.seek(0, SEEK_END); - if (seek_result.is_error()) - return seek_result.error(); + TRY(description.seek(0, SEEK_END)); } while (total_nwritten < data_size) {