Fredrik Fornwall
5 years ago
3 changed files with 41 additions and 78 deletions
@ -1,76 +0,0 @@ |
|||
--- go-ethereum-1.8.23/vendor/github.com/karalabe/usb/hidapi/libusb/hid.c 2019-02-20 10:48:12.000000000 +0200
|
|||
+++ go-ethereum-1.8.23.mod/vendor/github.com/karalabe/usb/hidapi/libusb/hid.c 2019-04-10 12:56:56.087538378 +0300
|
|||
@@ -60,9 +60,9 @@
|
|||
pthread_cond_t cond; |
|||
int count; |
|||
int trip_count; |
|||
-} pthread_barrier_t;
|
|||
+} _pthread_barrier_t;
|
|||
|
|||
-static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
|
|||
+static int _pthread_barrier_init(_pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
|
|||
{ |
|||
if(count == 0) { |
|||
errno = EINVAL; |
|||
@@ -82,14 +82,14 @@
|
|||
return 0; |
|||
} |
|||
|
|||
-static int pthread_barrier_destroy(pthread_barrier_t *barrier)
|
|||
+static int _pthread_barrier_destroy(_pthread_barrier_t *barrier)
|
|||
{ |
|||
pthread_cond_destroy(&barrier->cond); |
|||
pthread_mutex_destroy(&barrier->mutex); |
|||
return 0; |
|||
} |
|||
|
|||
-static int pthread_barrier_wait(pthread_barrier_t *barrier)
|
|||
+static int _pthread_barrier_wait(_pthread_barrier_t *barrier)
|
|||
{ |
|||
pthread_mutex_lock(&barrier->mutex); |
|||
++(barrier->count); |
|||
@@ -164,7 +164,7 @@
|
|||
pthread_t thread; |
|||
pthread_mutex_t mutex; /* Protects input_reports */ |
|||
pthread_cond_t condition; |
|||
- pthread_barrier_t barrier; /* Ensures correct startup sequence */
|
|||
+ _pthread_barrier_t barrier; /* Ensures correct startup sequence */
|
|||
int shutdown_thread; |
|||
int cancelled; |
|||
struct libusb_transfer *transfer; |
|||
@@ -185,7 +185,7 @@
|
|||
|
|||
pthread_mutex_init(&dev->mutex, NULL); |
|||
pthread_cond_init(&dev->condition, NULL); |
|||
- pthread_barrier_init(&dev->barrier, NULL, 2);
|
|||
+ _pthread_barrier_init(&dev->barrier, NULL, 2);
|
|||
|
|||
return dev; |
|||
} |
|||
@@ -193,7 +193,7 @@
|
|||
static void free_hid_device(hid_device *dev) |
|||
{ |
|||
/* Clean up the thread objects */ |
|||
- pthread_barrier_destroy(&dev->barrier);
|
|||
+ _pthread_barrier_destroy(&dev->barrier);
|
|||
pthread_cond_destroy(&dev->condition); |
|||
pthread_mutex_destroy(&dev->mutex); |
|||
|
|||
@@ -817,7 +817,7 @@
|
|||
libusb_submit_transfer(dev->transfer); |
|||
|
|||
/* Notify the main thread that the read thread is up and running. */ |
|||
- pthread_barrier_wait(&dev->barrier);
|
|||
+ _pthread_barrier_wait(&dev->barrier);
|
|||
|
|||
/* Handle all the events. */ |
|||
while (!dev->shutdown_thread) { |
|||
@@ -973,7 +973,7 @@
|
|||
pthread_create(&dev->thread, NULL, read_thread, dev); |
|||
|
|||
/* Wait here for the read thread to be initialized. */ |
|||
- pthread_barrier_wait(&dev->barrier);
|
|||
+ _pthread_barrier_wait(&dev->barrier);
|
|||
|
|||
} |
|||
free(dev_path); |
@ -0,0 +1,39 @@ |
|||
This patch will not be necessary once https://github.com/karalabe/usb/pull/14 has been merged. |
|||
|
|||
diff -u -r ../go-ethereum-1.9.9/accounts/usbwallet/hub.go ./accounts/usbwallet/hub.go
|
|||
--- ../go-ethereum-1.9.9/accounts/usbwallet/hub.go 2019-12-06 09:51:37.000000000 +0000
|
|||
+++ ./accounts/usbwallet/hub.go 2019-12-12 00:16:14.379913000 +0000
|
|||
@@ -26,7 +26,7 @@
|
|||
"github.com/ethereum/go-ethereum/accounts" |
|||
"github.com/ethereum/go-ethereum/event" |
|||
"github.com/ethereum/go-ethereum/log" |
|||
- "github.com/karalabe/usb"
|
|||
+ "github.com/fornwall/usb"
|
|||
) |
|||
|
|||
// LedgerScheme is the protocol scheme prefixing account and wallet URLs. |
|||
diff -u -r ../go-ethereum-1.9.9/accounts/usbwallet/wallet.go ./accounts/usbwallet/wallet.go
|
|||
--- ../go-ethereum-1.9.9/accounts/usbwallet/wallet.go 2019-12-06 09:51:37.000000000 +0000
|
|||
+++ ./accounts/usbwallet/wallet.go 2019-12-12 00:16:26.669913000 +0000
|
|||
@@ -31,7 +31,7 @@
|
|||
"github.com/ethereum/go-ethereum/core/types" |
|||
"github.com/ethereum/go-ethereum/crypto" |
|||
"github.com/ethereum/go-ethereum/log" |
|||
- "github.com/karalabe/usb"
|
|||
+ "github.com/fornwall/usb"
|
|||
) |
|||
|
|||
// Maximum time between wallet health checks to detect USB unplugs. |
|||
diff -u -r ../go-ethereum-1.9.9/go.mod ./go.mod
|
|||
--- ../go-ethereum-1.9.9/go.mod 2019-12-06 09:51:37.000000000 +0000
|
|||
+++ ./go.mod 2019-12-12 00:09:11.128276000 +0000
|
|||
@@ -33,7 +33,7 @@
|
|||
github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883 |
|||
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 |
|||
github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21 |
|||
- github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356
|
|||
+ github.com/fornwall/usb v0.0.0-20191212001557-3a1f5af8866c
|
|||
github.com/kr/pretty v0.1.0 // indirect |
|||
|
|||
github.com/kylelemons/godebug v1.1.0 // indirect |
|||
github.com/mattn/go-colorable v0.1.0 |
Loading…
Reference in new issue