1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +00:00

Kernel: Use KResultOr and TRY() for MasterPTY

This commit is contained in:
Andreas Kling 2021-09-07 13:57:33 +02:00
parent 01993d0af3
commit 631b8e90cd
3 changed files with 6 additions and 18 deletions

View file

@ -42,9 +42,7 @@ KResultOr<NonnullRefPtr<OpenFileDescription>> PTYMultiplexer::open(int options)
return EBUSY;
auto master_index = freelist.take_last();
auto master = MasterPTY::try_create(master_index);
if (!master)
return ENOMEM;
auto master = TRY(MasterPTY::try_create(master_index));
dbgln_if(PTMX_DEBUG, "PTYMultiplexer::open: Vending master {}", master->index());
auto description = TRY(OpenFileDescription::try_create(*master));
description->set_rw_mode(options);