mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
Kernel: Let MouseDevice and KeyboardDevice write method return EINVAL
Currently, writing anything to `/dev/mouse0` or `/dev/keyboard0` causes the Kernel to panic. The reason for this is that `[Mouse,Keyboard]Device::write` always returns 0, which is explicitly prohibited by `VERIFY` macro in `Process::sys$write`. The fix seems trivial; `write` should return EINVAL instead (as is the case with, for example, `KCOVDevice`).
This commit is contained in:
parent
6e1f6bd684
commit
c6e23e45c5
4 changed files with 2 additions and 12 deletions
|
@ -306,11 +306,6 @@ KResultOr<size_t> KeyboardDevice::read(OpenFileDescription&, u64, UserOrKernelBu
|
|||
return nread;
|
||||
}
|
||||
|
||||
KResultOr<size_t> KeyboardDevice::write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
KResult KeyboardDevice::ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg)
|
||||
{
|
||||
switch (request) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue