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

Kernel: Fix failing in can_read()/can_write()

Now that the SystemMonitor queries which open files can be read and written to,
having can_read()/can_write() unconditionally call ASSERT_NOT_REACHED() leads
to system crashes when inspecting the WindowServer.

Instead, just return true from can_read()/can_write() (indicating that the
read()/write() syscalls should not block) and return -EINVAL when trying to
actually read from or write to these devices.
This commit is contained in:
Sergey Bugaev 2019-11-13 15:54:22 +03:00 committed by Andreas Kling
parent fabdc8cdcb
commit cfdbb712fb
4 changed files with 8 additions and 48 deletions

View file

@ -81,23 +81,3 @@ int MBVGADevice::ioctl(FileDescription&, unsigned request, unsigned arg)
return -EINVAL;
};
}
bool MBVGADevice::can_read(const FileDescription&) const
{
ASSERT_NOT_REACHED();
}
bool MBVGADevice::can_write(const FileDescription&) const
{
ASSERT_NOT_REACHED();
}
ssize_t MBVGADevice::read(FileDescription&, u8*, ssize_t)
{
ASSERT_NOT_REACHED();
}
ssize_t MBVGADevice::write(FileDescription&, const u8*, ssize_t)
{
ASSERT_NOT_REACHED();
}