summaryrefslogtreecommitdiffstats
path: root/rfkill.c
diff options
context:
space:
mode:
authorJohannes Berg2009-07-05 14:37:40 +0200
committerJohannes Berg2009-07-05 14:37:40 +0200
commit6e4e0b50005c68cd15dba0300c3fdf65503750fd (patch)
tree02d7e1d1626f9164dcf216d46a8b34b9576ab283 /rfkill.c
parentuse right event size for read() (diff)
downloadkernel-qcow2-util-linux-6e4e0b50005c68cd15dba0300c3fdf65503750fd.tar.gz
kernel-qcow2-util-linux-6e4e0b50005c68cd15dba0300c3fdf65503750fd.tar.xz
kernel-qcow2-util-linux-6e4e0b50005c68cd15dba0300c3fdf65503750fd.zip
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.
Diffstat (limited to 'rfkill.c')
-rw-r--r--rfkill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rfkill.c b/rfkill.c
index 6b29144b1..4d4b6b97f 100644
--- a/rfkill.c
+++ b/rfkill.c
@@ -49,7 +49,7 @@ static void rfkill_event(void)
break;
}
- if (len != sizeof(event)) {
+ if (len != RFKILL_EVENT_SIZE_V1) {
fprintf(stderr, "Wrong size of RFKILL event\n");
continue;
}
@@ -137,7 +137,7 @@ static void rfkill_list(void)
break;
}
- if (len != sizeof(event)) {
+ if (len != RFKILL_EVENT_SIZE_V1) {
fprintf(stderr, "Wrong size of RFKILL event\n");
continue;
}