summaryrefslogtreecommitdiff
path: root/Kernel/TTY
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-07 13:46:11 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-07 13:53:14 +0200
commit01993d0af34bb41c9ac8363e2fb584f42e191d38 (patch)
tree9a45435991ef5902f712e137c5db0f4f0c7a36d5 /Kernel/TTY
parent213b8868af6028c98cf96b0a668fc3dda8ba5958 (diff)
downloadserenity-01993d0af34bb41c9ac8363e2fb584f42e191d38.zip
Kernel: Make DoubleBuffer::try() return KResultOr
This tidies up error propagation in a number of places.
Diffstat (limited to 'Kernel/TTY')
-rw-r--r--Kernel/TTY/MasterPTY.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/TTY/MasterPTY.cpp b/Kernel/TTY/MasterPTY.cpp
index cdf34f176f..d539cbc5f9 100644
--- a/Kernel/TTY/MasterPTY.cpp
+++ b/Kernel/TTY/MasterPTY.cpp
@@ -18,11 +18,11 @@ namespace Kernel {
RefPtr<MasterPTY> MasterPTY::try_create(unsigned int index)
{
- auto buffer = DoubleBuffer::try_create();
- if (!buffer)
+ auto buffer_or_error = DoubleBuffer::try_create();
+ if (buffer_or_error.is_error())
return {};
- auto master_pty = adopt_ref_if_nonnull(new (nothrow) MasterPTY(index, buffer.release_nonnull()));
+ auto master_pty = adopt_ref_if_nonnull(new (nothrow) MasterPTY(index, buffer_or_error.release_value()));
if (!master_pty)
return {};