summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/disk.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/disk.c b/src/disk.c
index c048a56..f58b1dd 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -363,9 +363,17 @@ int disk_init(struct usb_device_info * dev) {
fclose(f);
- if ( devnum != device->devnum || device->bus->location != busnum )
+ if ( device->devnum != devnum )
continue;
+ if ( device->bus->location ) {
+ if ( device->bus->location != busnum )
+ continue;
+ } else if ( device->bus->dirname[0] ) {
+ if ( atoi(device->bus->dirname) != (int)busnum )
+ continue;
+ }
+
if ( sscanf(dirent->d_name, "%d:%d", &maj2, &min2) != 2 ) {
maj2 = -1;
min2 = -1;