diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-07 13:46:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-07 13:53:14 +0200 |
commit | 01993d0af34bb41c9ac8363e2fb584f42e191d38 (patch) | |
tree | 9a45435991ef5902f712e137c5db0f4f0c7a36d5 /Kernel/FileSystem | |
parent | 213b8868af6028c98cf96b0a668fc3dda8ba5958 (diff) | |
download | serenity-01993d0af34bb41c9ac8363e2fb584f42e191d38.zip |
Kernel: Make DoubleBuffer::try() return KResultOr
This tidies up error propagation in a number of places.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/FIFO.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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<int> s_next_fifo_id = 1; RefPtr<FIFO> 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<NonnullRefPtr<OpenFileDescription>> FIFO::open_direction(FIFO::Direction direction) |