mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +00:00
Kernel: Use TRY() in PTYMultiplexer::open()
This commit is contained in:
parent
4d961387c1
commit
5e2bae700d
1 changed files with 3 additions and 5 deletions
|
@ -46,11 +46,9 @@ KResultOr<NonnullRefPtr<FileDescription>> PTYMultiplexer::open(int options)
|
||||||
if (!master)
|
if (!master)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
dbgln_if(PTMX_DEBUG, "PTYMultiplexer::open: Vending master {}", master->index());
|
dbgln_if(PTMX_DEBUG, "PTYMultiplexer::open: Vending master {}", master->index());
|
||||||
auto description = FileDescription::try_create(*master);
|
auto description = TRY(FileDescription::try_create(*master));
|
||||||
if (!description.is_error()) {
|
description->set_rw_mode(options);
|
||||||
description.value()->set_rw_mode(options);
|
description->set_file_flags(options);
|
||||||
description.value()->set_file_flags(options);
|
|
||||||
}
|
|
||||||
return description;
|
return description;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue