From 1fa054b409b00ae9bc0015ccd79d1ededd14cb7b Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 31 Oct 2014 22:40:34 +0100 Subject: [PATCH] Use the libusb autodetach functionality only if available. The libusb autodetach kernel driver functionality is only available in recent versions. --- src/suunto_eonsteel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/suunto_eonsteel.c b/src/suunto_eonsteel.c index 0c662c6..1761140 100644 --- a/src/suunto_eonsteel.c +++ b/src/suunto_eonsteel.c @@ -504,7 +504,10 @@ suunto_eonsteel_device_open(dc_device_t **out, dc_context_t *context, const char return DC_STATUS_IO; } +#if defined(LIBUSB_API_VERSION) && (LIBUSB_API_VERSION >= 0x01000102) libusb_set_auto_detach_kernel_driver(eon->handle, 1); +#endif + libusb_claim_interface(eon->handle, 0); if (initialize_eonsteel(eon) < 0) {