1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

Kernel: Simplify Device::open().

This commit is contained in:
Andreas Kling 2019-04-24 02:20:14 +02:00
parent c1b310c5bf
commit ca9ed13643
3 changed files with 4 additions and 9 deletions

View file

@ -30,6 +30,7 @@ PTYMultiplexer::~PTYMultiplexer()
KResultOr<Retained<FileDescriptor>> PTYMultiplexer::open(int options)
{
UNUSED_PARAM(options);
LOCKER(m_lock);
if (m_freelist.is_empty())
return KResult(-EBUSY);
@ -38,7 +39,7 @@ KResultOr<Retained<FileDescriptor>> PTYMultiplexer::open(int options)
#ifdef PTMX_DEBUG
dbgprintf("PTYMultiplexer::open: Vending master %u\n", master->index());
#endif
return VFS::the().open(move(master), options);
return FileDescriptor::create(master.ptr());
}
void PTYMultiplexer::notify_master_destroyed(Badge<MasterPTY>, unsigned index)