diff options
-rw-r--r-- | src/usb.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2009 Hector Martin <hector@marcansoft.com> | 4 | * Copyright (C) 2009 Hector Martin <hector@marcansoft.com> |
5 | * Copyright (C) 2009 Nikias Bassen <nikias@gmx.li> | 5 | * Copyright (C) 2009 Nikias Bassen <nikias@gmx.li> |
6 | * Copyright (C) 2009 Martin Szulecki <opensuse@sukimashita.com> | 6 | * Copyright (C) 2009-2020 Martin Szulecki <martin.szulecki@libimobiledevice.org> |
7 | * Copyright (C) 2014 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xamarin.com> | 7 | * Copyright (C) 2014 Mikkel Kamstrup Erlandsen <mikkel.kamstrup@xamarin.com> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
@@ -801,7 +801,11 @@ int usb_init(void) | |||
801 | device_polling = 1; | 801 | device_polling = 1; |
802 | res = libusb_init(NULL); | 802 | res = libusb_init(NULL); |
803 | 803 | ||
804 | #if LIBUSB_API_VERSION >= 0x01000106 | ||
805 | 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))); | ||
806 | #else | ||
804 | libusb_set_debug(NULL, (log_level >= LL_DEBUG ? LIBUSB_LOG_LEVEL_DEBUG: (log_level >= LL_WARNING ? LIBUSB_LOG_LEVEL_WARNING: LIBUSB_LOG_LEVEL_NONE))); | 807 | libusb_set_debug(NULL, (log_level >= LL_DEBUG ? LIBUSB_LOG_LEVEL_DEBUG: (log_level >= LL_WARNING ? LIBUSB_LOG_LEVEL_WARNING: LIBUSB_LOG_LEVEL_NONE))); |
808 | #endif | ||
805 | 809 | ||
806 | if(res != 0) { | 810 | if(res != 0) { |
807 | usbmuxd_log(LL_FATAL, "libusb_init failed: %s", libusb_error_name(res)); | 811 | usbmuxd_log(LL_FATAL, "libusb_init failed: %s", libusb_error_name(res)); |