From c1a897e63513c9647666970794c1684b2439501e Mon Sep 17 00:00:00 2001 From: mickeyl Date: Fri, 10 Oct 2003 00:15:28 +0000 Subject: Question: What's wrong in select(1, [], NULL, NULL, {100, 0} = 0 (timeout) ? Answer: It would help to give select the correct filedescriptor... /me hugs strace --- (limited to 'libopie2') diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 767651e..dc2e388 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp @@ -593,7 +593,7 @@ int OWirelessNetworkInterface::channel() const void OWirelessNetworkInterface::setChannel( int c ) const { - if ( c ) + if ( !c ) { qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); return; diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 38ca1a1..6331b2d 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -1143,7 +1143,7 @@ OPacket* OPacketCapturer::next( int time ) FD_SET( pcap_fileno( _pch ), &fds ); tv.tv_sec = time / 1000; tv.tv_usec = time % 1000; - int retval = select( 1, &fds, NULL, NULL, &tv); + int retval = select( pcap_fileno( _pch )+1, &fds, NULL, NULL, &tv); if ( retval > 0 ) // clear to read! return next(); else -- cgit v0.9.0.2