summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/usb.c b/src/usb.c
index e334707..abc4a2b 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -827,17 +827,17 @@ int usb_init(void)
device_polling = 1;
res = libusb_init(NULL);
+ if (res != 0) {
+ usbmuxd_log(LL_FATAL, "libusb_init failed: %s", libusb_error_name(res));
+ return -1;
+ }
+
#if LIBUSB_API_VERSION >= 0x01000106
libusb_set_option(NULL, LIBUSB_OPTION_LOG_LEVEL, (log_level >= LL_DEBUG ? LIBUSB_LOG_LEVEL_DEBUG: (log_level >= LL_WARNING ? LIBUSB_LOG_LEVEL_WARNING: LIBUSB_LOG_LEVEL_NONE)));
#else
libusb_set_debug(NULL, (log_level >= LL_DEBUG ? LIBUSB_LOG_LEVEL_DEBUG: (log_level >= LL_WARNING ? LIBUSB_LOG_LEVEL_WARNING: LIBUSB_LOG_LEVEL_NONE)));
#endif
- if(res != 0) {
- usbmuxd_log(LL_FATAL, "libusb_init failed: %s", libusb_error_name(res));
- return -1;
- }
-
collection_init(&device_list);
#ifdef HAVE_LIBUSB_HOTPLUG_API