Marcus Meissner
62bd861748
Fix libusb usage... gphoto2 --auto-detect crashes without this patch.. as well as shotwell startup in some cases... OBS-URL: https://build.opensuse.org/request/show/105827 OBS-URL: https://build.opensuse.org/package/show/graphics/libgphoto2?expand=0&rev=60
48 lines
1.2 KiB
Diff
48 lines
1.2 KiB
Diff
--- libusb1.c.orig 2011-11-13 14:50:32.000000000 +0100
|
|
+++ libusb1.c 2012-02-18 23:44:37.034378810 +0100
|
|
@@ -85,7 +85,7 @@
|
|
static libusb_device **devs = NULL;
|
|
|
|
static ssize_t
|
|
-load_devicelist (void) {
|
|
+load_devicelist (libusb_context *ctx) {
|
|
time_t xtime;
|
|
|
|
time(&xtime);
|
|
@@ -96,7 +96,7 @@
|
|
devs = NULL;
|
|
}
|
|
if (!nrofdevs)
|
|
- nrofdevs = libusb_get_device_list (NULL, &devs);
|
|
+ nrofdevs = libusb_get_device_list (ctx, &devs);
|
|
return nrofdevs;
|
|
}
|
|
|
|
@@ -114,7 +114,7 @@
|
|
CHECK (gp_port_info_list_append (list, info));
|
|
|
|
libusb_init (NULL);
|
|
- nrofdevs = load_devicelist ();
|
|
+ nrofdevs = load_devicelist (NULL);
|
|
|
|
for (d = 0; d < nrofdevs; d++) {
|
|
struct libusb_device_descriptor desc;
|
|
@@ -766,7 +766,7 @@
|
|
return GP_ERROR_BAD_PARAMETERS;
|
|
}
|
|
|
|
- nrofdevs = load_devicelist ();
|
|
+ nrofdevs = load_devicelist (port->pl->ctx);
|
|
|
|
for (d = 0; d < nrofdevs; d++) {
|
|
struct libusb_device_descriptor desc;
|
|
@@ -1067,7 +1067,7 @@
|
|
if (!class)
|
|
return GP_ERROR_BAD_PARAMETERS;
|
|
|
|
- nrofdevs = load_devicelist ();
|
|
+ nrofdevs = load_devicelist (port->pl->ctx);
|
|
for (d = 0; d < nrofdevs; d++) {
|
|
struct libusb_device_descriptor desc;
|
|
struct libusb_config_descriptor *confdesc;
|