dect
/
libpcap
Archived
13
0
Fork 0

pcap_read: Check the error code of select against EINTR. Reported by

Sebastian.
This commit is contained in:
torsten 2000-10-18 23:47:41 +00:00
parent 9cd2d87ddd
commit 0ae7f68987
1 changed files with 6 additions and 3 deletions

View File

@ -26,7 +26,7 @@
*/
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.32 2000-10-18 08:32:55 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.33 2000-10-18 23:47:41 torsten Exp $ (LBL)";
#endif
/*
@ -241,8 +241,11 @@ pcap_read(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
*/
FD_ZERO(&read_fds);
FD_SET(handle->fd, &read_fds);
status = select(handle->fd + 1,
&read_fds, NULL, NULL, &tv);
do {
status = select(handle->fd + 1,
&read_fds, NULL, NULL, &tv);
} while (status == -1 && errno == EINTR);
if (status == -1) {
snprintf(handle->errbuf, sizeof(handle->errbuf),
"select: %s", pcap_strerror(errno));