summaryrefslogtreecommitdiff
path: root/Kernel/TTY/PTYMultiplexer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 21:38:29 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-06 01:55:27 +0200
commit5e2bae700d6878e2de9813dcf66b170700da0ba3 (patch)
tree0c3b802ac582b9ef0f073fbba4df02dc8b535265 /Kernel/TTY/PTYMultiplexer.cpp
parent4d961387c1fcdd05120f99c6cd0642ee5726fd4a (diff)
downloadserenity-5e2bae700d6878e2de9813dcf66b170700da0ba3.zip
Kernel: Use TRY() in PTYMultiplexer::open()
Diffstat (limited to 'Kernel/TTY/PTYMultiplexer.cpp')
-rw-r--r--Kernel/TTY/PTYMultiplexer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Kernel/TTY/PTYMultiplexer.cpp b/Kernel/TTY/PTYMultiplexer.cpp
index ebedf495c1..271f1af1f2 100644
--- a/Kernel/TTY/PTYMultiplexer.cpp
+++ b/Kernel/TTY/PTYMultiplexer.cpp
@@ -46,11 +46,9 @@ KResultOr<NonnullRefPtr<FileDescription>> PTYMultiplexer::open(int options)
if (!master)
return ENOMEM;
dbgln_if(PTMX_DEBUG, "PTYMultiplexer::open: Vending master {}", master->index());
- auto description = FileDescription::try_create(*master);
- if (!description.is_error()) {
- description.value()->set_rw_mode(options);
- description.value()->set_file_flags(options);
- }
+ auto description = TRY(FileDescription::try_create(*master));
+ description->set_rw_mode(options);
+ description->set_file_flags(options);
return description;
});
}