From 01993d0af34bb41c9ac8363e2fb584f42e191d38 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 7 Sep 2021 13:46:11 +0200 Subject: Kernel: Make DoubleBuffer::try() return KResultOr This tidies up error propagation in a number of places. --- Kernel/FileSystem/FIFO.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Kernel/FileSystem') diff --git a/Kernel/FileSystem/FIFO.cpp b/Kernel/FileSystem/FIFO.cpp index a9cfd1e7fa..42c76c33ab 100644 --- a/Kernel/FileSystem/FIFO.cpp +++ b/Kernel/FileSystem/FIFO.cpp @@ -18,10 +18,10 @@ static Atomic s_next_fifo_id = 1; RefPtr FIFO::try_create(UserID uid) { - auto buffer = DoubleBuffer::try_create(); - if (buffer) - return adopt_ref_if_nonnull(new (nothrow) FIFO(uid, buffer.release_nonnull())); - return {}; + auto buffer_or_error = DoubleBuffer::try_create(); + if (buffer_or_error.is_error()) + return {}; + return adopt_ref_if_nonnull(new (nothrow) FIFO(uid, buffer_or_error.release_value())); } KResultOr> FIFO::open_direction(FIFO::Direction direction) -- cgit v1.2.3