mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
Kernel: Simplify Device::open().
This commit is contained in:
parent
c1b310c5bf
commit
ca9ed13643
3 changed files with 4 additions and 9 deletions
|
@ -15,7 +15,8 @@ Device::~Device()
|
||||||
|
|
||||||
KResultOr<Retained<FileDescriptor>> Device::open(int options)
|
KResultOr<Retained<FileDescriptor>> Device::open(int options)
|
||||||
{
|
{
|
||||||
return VFS::the().open(*this, options);
|
UNUSED_PARAM(options);
|
||||||
|
return FileDescriptor::create(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Device::close()
|
void Device::close()
|
||||||
|
|
|
@ -120,13 +120,6 @@ void VFS::traverse_directory_inode(Inode& dir_inode, Function<bool(const FS::Dir
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
KResultOr<Retained<FileDescriptor>> VFS::open(RetainPtr<Device>&& device, int options)
|
|
||||||
{
|
|
||||||
// FIXME: Respect options.
|
|
||||||
(void)options;
|
|
||||||
return FileDescriptor::create(move(device));
|
|
||||||
}
|
|
||||||
|
|
||||||
KResult VFS::utime(StringView path, Inode& base, time_t atime, time_t mtime)
|
KResult VFS::utime(StringView path, Inode& base, time_t atime, time_t mtime)
|
||||||
{
|
{
|
||||||
auto descriptor_or_error = VFS::the().open(move(path), 0, 0, base);
|
auto descriptor_or_error = VFS::the().open(move(path), 0, 0, base);
|
||||||
|
|
|
@ -30,6 +30,7 @@ PTYMultiplexer::~PTYMultiplexer()
|
||||||
|
|
||||||
KResultOr<Retained<FileDescriptor>> PTYMultiplexer::open(int options)
|
KResultOr<Retained<FileDescriptor>> PTYMultiplexer::open(int options)
|
||||||
{
|
{
|
||||||
|
UNUSED_PARAM(options);
|
||||||
LOCKER(m_lock);
|
LOCKER(m_lock);
|
||||||
if (m_freelist.is_empty())
|
if (m_freelist.is_empty())
|
||||||
return KResult(-EBUSY);
|
return KResult(-EBUSY);
|
||||||
|
@ -38,7 +39,7 @@ KResultOr<Retained<FileDescriptor>> PTYMultiplexer::open(int options)
|
||||||
#ifdef PTMX_DEBUG
|
#ifdef PTMX_DEBUG
|
||||||
dbgprintf("PTYMultiplexer::open: Vending master %u\n", master->index());
|
dbgprintf("PTYMultiplexer::open: Vending master %u\n", master->index());
|
||||||
#endif
|
#endif
|
||||||
return VFS::the().open(move(master), options);
|
return FileDescriptor::create(master.ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PTYMultiplexer::notify_master_destroyed(Badge<MasterPTY>, unsigned index)
|
void PTYMultiplexer::notify_master_destroyed(Badge<MasterPTY>, unsigned index)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue