linux: Assume usbfs path = /dev/bus/usb when using UDEV
authorHans de Goede <hdegoede@redhat.com>
Mon, 3 Aug 2015 08:06:05 +0000 (10:06 +0200)
committerChris Dickens <christopher.a.dickens@gmail.com>
Wed, 5 Aug 2015 05:50:54 +0000 (22:50 -0700)
commita6a7b53b6312ac06df87e501bf65340b457d0aaf
tree410031f9ee1c0f2882ff656969d7d5a57b79e8db
parent4fe0f7e7a9c32b6b68bb302236bc675a487d5df5
linux: Assume usbfs path = /dev/bus/usb when using UDEV

On some exotic hardware, e.g. HP ProLiant Moonshot Cartridge servers there
are no usb controllers, so no usb devices at all.

In this case currently libusb_init will fail, because find_usbfs_path
fails. Many apps don't handle this gracefully, and even if they do not crash
the result still is not pretty, e.g.:

unable to initialize libusb: -99

Where one simply would expect empty output.

Since on systems using udev the usbfs path should always be /dev/bus/usb
(as that gets created by udev), simply assume /dev/bus/usb when build with
USE_UDEV and the path cannot be found in the traditional way.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/os/linux_usbfs.c
libusb/version_nano.h