aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-usb-linux.c
diff options
context:
space:
mode:
authorguy <guy>2008-11-24 18:06:39 +0000
committerguy <guy>2008-11-24 18:06:39 +0000
commit47dad25d57b85de9e2084a7d25e0b6e6daec1e3e (patch)
treeaf77359a582a149423d7b3b57b07c3813e572019 /pcap-usb-linux.c
parentdc524007693a4eebc7335a334aa0f6869a8cdc1d (diff)
From Roberto Mariani: get rid of some unused #defines.
Close the descriptor before returning with PCAP_ERROR_RFMON_NOTSUP.
Diffstat (limited to 'pcap-usb-linux.c')
-rw-r--r--pcap-usb-linux.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index 3858e84..c79211e 100644
--- a/pcap-usb-linux.c
+++ b/pcap-usb-linux.c
@@ -34,7 +34,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.25 2008-11-24 17:40:19 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.26 2008-11-24 18:06:39 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -66,13 +66,6 @@ static const char rcsid[] _U_ =
#define USB_BUS_DIR "/proc/bus/usb"
#define USB_LINE_LEN 4096
-
-#define PIPE_IN 0x80
-#define PIPE_ISOCHRONOUS 0
-#define PIPE_INTERRUPT 1
-#define PIPE_CONTROL 2
-#define PIPE_BULK 3
-
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htols(s) s
#define htoll(l) l
@@ -230,6 +223,7 @@ usb_activate(pcap_t* handle)
/*
* Monitor mode doesn't apply to USB devices.
*/
+ close(handle->fd);
return PCAP_ERROR_RFMON_NOTSUP;
}
@@ -262,17 +256,19 @@ usb_activate(pcap_t* handle)
"Can't open USB bus file %s: %s", full_path, strerror(errno));
return PCAP_ERROR;
}
+
+ if (handle->opt.rfmon) {
+ /*
+ * Monitor mode doesn't apply to USB devices.
+ */
+ close(handle->fd);
+ return PCAP_ERROR_RFMON_NOTSUP;
+ }
+
handle->stats_op = usb_stats_linux;
handle->read_op = usb_read_linux;
}
- if (handle->opt.rfmon) {
- /*
- * Monitor mode doesn't apply to USB devices.
- */
- return PCAP_ERROR_RFMON_NOTSUP;
- }
-
/*
* "handle->fd" is a real file, so "select()" and "poll()"
* work on it.