Have "pcap_setnonblock()" just return 0 on success, not the new value of
the file descriptor flags; there's no guarantee that it will actually *affect* the file descriptor flags (consider a memory-mapped capture mechanism such as the Linux 2.4 mechanism, where all "non-blocking mode" means is "don't do a 'select()' or 'poll()' if there aren't any new packets in the memory-mapped buffer") or, in fact, that there are file descriptor flags to affect (consider WinPcap).
This commit is contained in:
parent
4c16994790
commit
99f5637e53
4
pcap.c
4
pcap.c
|
@ -33,7 +33,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static const char rcsid[] =
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.37 2001-12-09 05:10:03 guy Exp $ (LBL)";
|
||||
"@(#) $Header: /tcpdump/master/libpcap/pcap.c,v 1.38 2001-12-29 21:55:32 guy Exp $ (LBL)";
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -226,7 +226,7 @@ pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf)
|
|||
pcap_strerror(errno));
|
||||
return (-1);
|
||||
}
|
||||
return (fdflags);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Reference in New Issue