summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Rousseau <ludovic.rousseau+github@gmail.com>2013-09-22 21:19:06 +0200
committerLudovic Rousseau <ludovic.rousseau+github@gmail.com>2013-09-28 12:16:13 +0200
commitd4dabfd14e50144c2935c4ef30202a8dd46b5ae6 (patch)
tree028073320133e1b22d88939cefd9853fd10fd8a6
parentaa00030b78b4e46511c32c76c08ea031eacef8d1 (diff)
downloadlibusb-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).
-rw-r--r--examples/hotplugtest.c4
-rw-r--r--libusb/version_nano.h2
2 files changed, 4 insertions, 2 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);
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index a387990..0d147a7 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10840
+#define LIBUSB_NANO 10841