summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-01-28 19:25:11 +0100
committerGravatar Nikias Bassen2019-01-28 19:25:11 +0100
commit5da2a0d7d60f79d93c283964888c6fbbc17be1a3 (patch)
treef15e2785c9bd2fba4808e4348f79a665c0cb77b1 /src
parent1e2ede1f8a972670370c0621d42e54d7cf719766 (diff)
downloadlibirecovery-5da2a0d7d60f79d93c283964888c6fbbc17be1a3.tar.gz
libirecovery-5da2a0d7d60f79d93c283964888c6fbbc17be1a3.tar.bz2
Use new libusb API to set debug level if libusb version is new enough
Diffstat (limited to 'src')
-rw-r--r--src/libirecovery.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c
index 02d0075..cd247ad 100644
--- a/src/libirecovery.c
+++ b/src/libirecovery.c
@@ -1664,7 +1664,11 @@ IRECV_API void irecv_set_debug_level(int level) {
#ifndef WIN32
#ifndef HAVE_IOKIT
if(libirecovery_context) {
+#if LIBUSB_API_VERSION >= 0x01000106
+ libusb_set_option(libirecovery_context, LIBUSB_OPTION_LOG_LEVEL, libirecovery_debug > 2 ? 1: 0);
+#else
libusb_set_debug(libirecovery_context, libirecovery_debug > 2 ? 1: 0);
+#endif
}
#endif
#endif