]> The Tcpdump Group git mirrors - libpcap/commit
Check whether libusb_init() succeeds, and give up if it doesn't.
authorGuy Harris <[email protected]>
Mon, 6 Aug 2012 22:25:30 +0000 (15:25 -0700)
committerGuy Harris <[email protected]>
Mon, 6 Aug 2012 22:26:19 +0000 (15:26 -0700)
commit9364528b46624fd14a86662d54ea550a4f45fe14
tree954a126c9be7e4ab071b3b159e64e6f1448eb707
parentf2d736f89c06393793de15c00b4f941e8c70f2b8
Check whether libusb_init() succeeds, and give up if it doesn't.

libusb_init() isn't guaranteed to succeed; it returns a (presumably)
non-zero error on failure.  If it doesn't return 0, just give up - we
presumably don't have a valid libusb_context pointer, which is probably
what's causing crashes when we call libusb_get_device_list() on a system
with no usbfs mounted.

This fixes bug 3554749 in the tracker, and a bunch of upstream bugs.
pcap-canusb-linux.c