libusb: add patch from upstream
Fixes https://github.com/termux/termux-app/issues/1928.
This commit is contained in:
parent
bd7dd8a9b3
commit
b9546f0082
@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A C library that provides generic access to USB devices"
|
|||||||
TERMUX_PKG_LICENSE="LGPL-2.1"
|
TERMUX_PKG_LICENSE="LGPL-2.1"
|
||||||
TERMUX_PKG_MAINTAINER="@termux"
|
TERMUX_PKG_MAINTAINER="@termux"
|
||||||
TERMUX_PKG_VERSION=1.0.24
|
TERMUX_PKG_VERSION=1.0.24
|
||||||
|
TERMUX_PKG_REVISION=1
|
||||||
TERMUX_PKG_SRCURL=https://github.com/libusb/libusb/archive/v${TERMUX_PKG_VERSION}.tar.gz
|
TERMUX_PKG_SRCURL=https://github.com/libusb/libusb/archive/v${TERMUX_PKG_VERSION}.tar.gz
|
||||||
TERMUX_PKG_SHA256=b7724c272dfc5713dce88ff717efd60f021ca5b7c8e30f08ebb2c42d2eea08ae
|
TERMUX_PKG_SHA256=b7724c272dfc5713dce88ff717efd60f021ca5b7c8e30f08ebb2c42d2eea08ae
|
||||||
TERMUX_PKG_BREAKS="libusb-dev"
|
TERMUX_PKG_BREAKS="libusb-dev"
|
||||||
|
35
packages/libusb/weak_authority.patch
Normal file
35
packages/libusb/weak_authority.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
commit e78cafbaa2692f5b6e8e8f0ff306f5826c5dd94d
|
||||||
|
Author: Mark Kuo <starryalley@gmail.com>
|
||||||
|
Date: Sun Jan 10 16:58:26 2021 +1100
|
||||||
|
|
||||||
|
linux_usbfs: Fix exit crash on Android
|
||||||
|
|
||||||
|
In commit "89b810ec Android: Add option LIBUSB_OPTION_WEAK_AUTHORITY
|
||||||
|
to support used in apk", we should also check weak_authority when
|
||||||
|
exiting the backend.
|
||||||
|
|
||||||
|
[dickens] Fixed whitespace
|
||||||
|
|
||||||
|
Closes #842
|
||||||
|
|
||||||
|
Signed-off-by: Mark Kuo <starryalley@gmail.com>
|
||||||
|
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
|
||||||
|
|
||||||
|
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
|
||||||
|
index 7175b35..4882c0f 100644
|
||||||
|
--- a/libusb/os/linux_usbfs.c
|
||||||
|
+++ b/libusb/os/linux_usbfs.c
|
||||||
|
@@ -415,6 +415,13 @@ static int op_init(struct libusb_context *ctx)
|
||||||
|
static void op_exit(struct libusb_context *ctx)
|
||||||
|
{
|
||||||
|
UNUSED(ctx);
|
||||||
|
+
|
||||||
|
+#ifdef __ANDROID__
|
||||||
|
+ if (weak_authority) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
usbi_mutex_static_lock(&linux_hotplug_startstop_lock);
|
||||||
|
assert(init_count != 0);
|
||||||
|
if (!--init_count) {
|
Loading…
Reference in New Issue
Block a user