From f68a2a4b0f2d3e46a95c5236b528c6ad4a721063 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Mon, 16 Nov 2015 12:07:18 +0000 Subject: [PATCH] sane_backends: Add patch for libusb context disabling --- .../sane_disable_libusb_context.patchset | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 media-gfx/sane_backends/patches/sane_disable_libusb_context.patchset diff --git a/media-gfx/sane_backends/patches/sane_disable_libusb_context.patchset b/media-gfx/sane_backends/patches/sane_disable_libusb_context.patchset new file mode 100644 index 000000000..5abe868e0 --- /dev/null +++ b/media-gfx/sane_backends/patches/sane_disable_libusb_context.patchset @@ -0,0 +1,50 @@ +From ed4c9a8b17ced9f1668084539509d7866438fdc4 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Mon, 16 Nov 2015 11:13:48 +0000 +Subject: Disable libusb context for Haiku + + +diff --git a/sanei/sanei_usb.c b/sanei/sanei_usb.c +index 9c07d22..e4f8b1d 100644 +--- a/sanei/sanei_usb.c ++++ b/sanei/sanei_usb.c +@@ -498,7 +498,12 @@ sanei_usb_init (void) + if (!sanei_usb_ctx) + { + DBG (4, "%s: initializing libusb-1.0\n", __func__); ++#ifdef __HAIKU__ ++ ret = libusb_init (NULL); ++ sanei_usb_ctx = -1; ++#else + ret = libusb_init (&sanei_usb_ctx); ++#endif + if (ret < 0) + { + DBG (1, +@@ -556,7 +561,11 @@ int i; + #ifdef HAVE_LIBUSB_1_0 + if (sanei_usb_ctx) + { ++#ifdef __HAIKU__ ++ libusb_exit (NULL); ++#else + libusb_exit (sanei_usb_ctx); ++#endif + /* reset libusb-1.0 context */ + sanei_usb_ctx=NULL; + } +@@ -880,7 +889,11 @@ static void libusb_scan_devices(void) + + DBG (4, "%s: Looking for libusb-1.0 devices\n", __func__); + ++#ifdef __HAIKU__ ++ ndev = libusb_get_device_list (NULL, &devlist); ++#else + ndev = libusb_get_device_list (sanei_usb_ctx, &devlist); ++#endif + if (ndev < 0) + { + DBG (1, +-- +2.2.2 +