From 25ccbe6e868f8a4bff229084aa8f3d650f6d5aab Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 14 Dec 2007 07:52:32 +0000 Subject: Don't use handle->fd before you've set it. --- pcap-usb-linux.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'pcap-usb-linux.c') 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); -- cgit v1.2.3