mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
hostusb: Properly handle 'usbX' sysfs files
Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=598272 Some files under /sys/bus/usb/devices/ have the format 'usbX', where X is the USB bus number. Use STRPREFIX to correctly parse the bus numbers.
This commit is contained in:
parent
3db47cb5d2
commit
fa6da6608a
@ -121,7 +121,7 @@ static int usbFindBusByVendor(unsigned vendor, unsigned product,
|
||||
char *tmpstr = de->d_name;
|
||||
unsigned found_bus, found_addr;
|
||||
|
||||
if (STREQ(de->d_name, "usb"))
|
||||
if (STRPREFIX(de->d_name, "usb"))
|
||||
tmpstr += 3;
|
||||
|
||||
if (virStrToLong_ui(tmpstr, &ignore, 10, &found_bus) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user