diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2019-11-13 15:54:22 +0300 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-13 16:37:04 +0100 |
commit | cfdbb712fbf4dbb8587d986eab77d77093da5fbf (patch) | |
tree | 01a59eb6cfdd4f9f8b676ed17d3e652bf7d267bd /Kernel/Devices/MBVGADevice.cpp | |
parent | fabdc8cdcb6c8bf1519b0f9e7b6e353d9000fc07 (diff) | |
download | serenity-cfdbb712fbf4dbb8587d986eab77d77093da5fbf.zip |
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.
Diffstat (limited to 'Kernel/Devices/MBVGADevice.cpp')
-rw-r--r-- | Kernel/Devices/MBVGADevice.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Kernel/Devices/MBVGADevice.cpp b/Kernel/Devices/MBVGADevice.cpp index 2b4554e7e5..887a06f355 100644 --- a/Kernel/Devices/MBVGADevice.cpp +++ b/Kernel/Devices/MBVGADevice.cpp @@ -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(); -} |