diff options
author | Ludovic Rousseau <ludovic.rousseau+github@gmail.com> | 2013-09-22 21:19:06 +0200 |
---|---|---|
committer | Ludovic Rousseau <ludovic.rousseau+github@gmail.com> | 2013-09-28 12:16:13 +0200 |
commit | d4dabfd14e50144c2935c4ef30202a8dd46b5ae6 (patch) | |
tree | 028073320133e1b22d88939cefd9853fd10fd8a6 /examples | |
parent | aa00030b78b4e46511c32c76c08ea031eacef8d1 (diff) | |
download | libusb-d4dabfd14e50144c2935c4ef30202a8dd46b5ae6.tar.gz |
examples: check the value returned by libusb_handle_events()
Problem detected by the Coverity tool
CID 1042539 (#1 of 1): Unchecked return value (CHECKED_RETURN)8.
check_return: Calling function "libusb_handle_events(libusb_context *)"
without checking return value (as is done elsewhere 6 out of 7 times).
Diffstat (limited to 'examples')
-rw-r--r-- | examples/hotplugtest.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/hotplugtest.c b/examples/hotplugtest.c index 6cdf0c8..368011b 100644 --- a/examples/hotplugtest.c +++ b/examples/hotplugtest.c @@ -95,7 +95,9 @@ int main(int argc, char *argv[]) } while (done < 2) { - libusb_handle_events (NULL); + rc = libusb_handle_events (NULL); + if (rc < 0) + printf("libusb_handle_events() failed: %s\n", libusb_error_name(rc)); } libusb_exit (NULL); |