summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libusb/core.c2
-rw-r--r--libusb/libusbi.h2
-rw-r--r--libusb/os/linux_usbfs.c4
3 files changed, 5 insertions, 3 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 68d32ce..63a7ecd 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -134,7 +134,7 @@ API_EXPORTED int libusb_get_device_list(struct libusb_device ***list)
if (!discdevs)
return -ENOMEM;
- r = usbi_backend->get_device_list(discdevs);
+ r = usbi_backend->get_device_list(&discdevs);
if (r < 0)
goto out;
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index 2d56d64..0ff418b 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -231,7 +231,7 @@ struct usbi_os_backend {
int (*init)(void);
void (*exit)(void);
- int (*get_device_list)(struct discovered_devs *discdevs);
+ int (*get_device_list)(struct discovered_devs **discdevs);
int (*open)(struct libusb_device_handle *handle);
void (*close)(struct libusb_device_handle *handle);
diff --git a/libusb/os/linux_usbfs.c b/libusb/os/linux_usbfs.c
index bfd526b..a64a7e7 100644
--- a/libusb/os/linux_usbfs.c
+++ b/libusb/os/linux_usbfs.c
@@ -333,9 +333,10 @@ out:
return r;
}
-static int op_get_device_list(struct discovered_devs *discdevs)
+static int op_get_device_list(struct discovered_devs **_discdevs)
{
struct dirent *entry;
+ struct discovered_devs *discdevs = *_discdevs;
int r = 0;
DIR *buses = opendir(usbfs_path);
if (!buses) {
@@ -364,6 +365,7 @@ static int op_get_device_list(struct discovered_devs *discdevs)
out:
closedir(buses);
+ *_discdevs = discdevs;
return r;
}