summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-06-16 15:44:46 -0400
committerAdam Jackson <ajax@redhat.com>2017-10-04 15:04:40 -0400
commit320e48c9217a8bdcd07dc8ce4aebec043e4afa3c (patch)
tree6cfcbb3a4768e45488b4df4469f29e965c0dc83a /hw
parentc5d409a292008c4219c77a1bdb7621eb0ac42991 (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> (cherry picked from commit 17ad6e5d5616039021455bc821d6ee2497f7ebde)
Diffstat (limited to 'hw')
-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");
}
}