diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-10-14 11:39:36 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-10-14 11:39:36 -0700 |
commit | 6afec6b6181b9cefc6b26b5d888ac539e1e57a99 (patch) | |
tree | 93fbde25f8539d394c1e79573f2e60237798c007 | |
parent | 003600f970ea92f745366795f87b71d38a7a393f (diff) | |
download | libpcap-test.tar.gz |
Try looking for the "all buses" text device in both locations.test
-rw-r--r-- | pcap-usb-linux.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c index 1e943639..98e7e32d 100644 --- a/pcap-usb-linux.c +++ b/pcap-usb-linux.c @@ -182,9 +182,15 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str) * No binary device; do we have the text device? */ fd = open(USB_TEXT_DIR"/0t", O_RDONLY, 0); + if (fd < 0) { + /* + * Not at the new location; try the old location. + */ + fd = open(USB_TEXT_DIR_OLD"/0t", O_RDONLY, 0); + } if (fd >= 0) { /* - * Yes. + * We found it. */ close(fd); if (pcap_add_if(alldevsp, "usbmon0", 0, "All USB buses", |