Johannes Berg [Sun, 5 Jul 2009 12:37:40 +0000 (14:37 +0200)]
check event size for version 1
If we ever increase the event struct size, then we
will need to handle multiple event sizes, so let's
define the current event size and check for that
so we remember to fix it up when (if ever) we need
to change things.
Johannes Berg [Sun, 5 Jul 2009 12:33:25 +0000 (14:33 +0200)]
use right event size for read()
In order to be compatible with future size increases of
the kernel's rfkill structure, userspace should only
read as much as it expects -- the kernel will truncate
the event read if necessary, which is the way we plan
to have compatibility between different versions, should
they ever be necessary.
Thus, the userspace tool needs to use the exact event
size for a read().
If the userspace tool is ever compiled with a newer
kernel then it will need to be adjusted to work with
older kernels, however.