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:
parent
01993d0af3
commit
631b8e90cd
3 changed files with 6 additions and 18 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue