1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 12:07:35 +00:00

Kernel: Convert MasterPTY creation to use DoubleBuffer factory

In order to remove the public DoubleBuffer constructor, we need to
convert the callers to the factory instead, allowing the caller to
observe OOM.
This commit is contained in:
Brian Gianforcaro 2021-08-01 01:54:09 -07:00 committed by Andreas Kling
parent f816abcbad
commit 43f930d3aa
3 changed files with 31 additions and 11 deletions

View file

@ -40,7 +40,7 @@ KResultOr<NonnullRefPtr<FileDescription>> PTYMultiplexer::open(int options)
if (m_freelist.is_empty())
return EBUSY;
auto master_index = m_freelist.take_last();
auto master = try_create<MasterPTY>(master_index);
auto master = MasterPTY::try_create(master_index);
if (!master)
return ENOMEM;
dbgln_if(PTMX_DEBUG, "PTYMultiplexer::open: Vending master {}", master->index());