]> git.ipfire.org Git - thirdparty/util-linux.git/commit
use right event size for read()
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 5 Jul 2009 12:33:25 +0000 (14:33 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Sun, 5 Jul 2009 12:33:25 +0000 (14:33 +0200)
commit51da1093e715266a8bb6be4f881c8be654053da8
tree44594f456cec3bb1d959a29b93afb0d2413f7971
parent6980381c65cc758cb0d4bb472555735e041732e1
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.
rfkill.c