summaryrefslogtreecommitdiff
path: root/hw/dmx
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-16 15:44:46 -0400
committerAdam Jackson <ajax@redhat.com>2017-06-20 16:39:23 -0400
commit17ad6e5d5616039021455bc821d6ee2497f7ebde (patch)
treef89047182d4dfb948623de088e42f4cf7f82e8eb /hw/dmx
parentfbc4da6fef2a0d2111284a19c26d83686ebcbd1f (diff)
dmx: Silence an unused-result warning
Modern glibc is very insistent that you care about whether write() succeeds: ../hw/dmx/input/usb-keyboard.c: In function ‘kbdUSBCtrl’: ../hw/dmx/input/usb-keyboard.c:292:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] write(priv->fd, &event, sizeof(event)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/dmx')
-rw-r--r--hw/dmx/input/usb-keyboard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/dmx/input/usb-keyboard.c b/hw/dmx/input/usb-keyboard.c
index e41ad40eb..b26c822c0 100644
--- a/hw/dmx/input/usb-keyboard.c
+++ b/hw/dmx/input/usb-keyboard.c
@@ -289,7 +289,8 @@ kbdUSBCtrl(DevicePtr pDev, KeybdCtrl * ctrl)
led = i;
event.code = led;
event.value = ! !(ctrl->leds & (1 << led));
- write(priv->fd, &event, sizeof(event));
+ if (write(priv->fd, &event, sizeof(event)) != sizeof(event))
+ DebugF("Failed to set LEDs!\n");
}
}