aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-usb-linux.c
diff options
context:
space:
mode:
authorguy <guy>2007-12-14 07:52:32 +0000
committerguy <guy>2007-12-14 07:52:32 +0000
commit25ccbe6e868f8a4bff229084aa8f3d650f6d5aab (patch)
treed7e7b3c8eabb617a66ca894ea90aad2e669d1d6b /pcap-usb-linux.c
parent82fa7a2f4380c950db8fd468bce5bf972f149ca0 (diff)
Don't use handle->fd before you've set it.
Diffstat (limited to 'pcap-usb-linux.c')
-rw-r--r--pcap-usb-linux.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pcap-usb-linux.c b/pcap-usb-linux.c
index c198134..a457d0b 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.18 2007-12-13 17:28:38 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-usb-linux.c,v 1.19 2007-12-14 07:52:32 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -205,12 +205,6 @@ usb_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errms
handle->offset = 0;
handle->linktype = DLT_USB_LINUX;
- /*
- * "handle->fd" is a real file , so "select()" and "poll()"
- * work on it.
- */
- handle->selectable_fd = handle->fd;
-
handle->inject_op = usb_inject_linux;
handle->setfilter_op = usb_setfilter_linux;
handle->setdirection_op = usb_setdirection_linux;
@@ -261,6 +255,12 @@ usb_open_live(const char* bus, int snaplen, int promisc , int to_ms, char* errms
handle->read_op = usb_read_linux;
}
+ /*
+ * "handle->fd" is a real file, so "select()" and "poll()"
+ * work on it.
+ */
+ handle->selectable_fd = handle->fd;
+
/* for plain binary access and text access we need to allocate the read
* buffer */
handle->buffer = malloc(handle->bufsize);