1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18: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:
Przemysław R. Kusiak 2021-09-18 04:07:19 +02:00 committed by Idan Horowitz
parent 6e1f6bd684
commit c6e23e45c5
4 changed files with 2 additions and 12 deletions

View file

@ -48,9 +48,4 @@ KResultOr<size_t> MouseDevice::read(OpenFileDescription&, u64, UserOrKernelBuffe
return nread;
}
KResultOr<size_t> MouseDevice::write(OpenFileDescription&, u64, const UserOrKernelBuffer&, size_t)
{
return 0;
}
}