From bd7c94c7e6da127a91217a98c0124bf3e7d656c9 Mon Sep 17 00:00:00 2001 From: doug Date: Tue, 24 Jul 2007 22:21:44 +0000 Subject: [PATCH] Hopefully fixes the interrupted system call fatal behaviour unearthed by the mass_ping -> ultra_scan migration. --- tcpip.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tcpip.cc b/tcpip.cc index f8fef5e9d..16869b5c2 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -1831,6 +1831,8 @@ int pcap_select(pcap_t *p, struct timeval *timeout) int fd, ret; fd_set rfds; + again: + if ((fd = my_pcap_get_selectable_fd(p)) == -1) return -1; @@ -1839,8 +1841,12 @@ int pcap_select(pcap_t *p, struct timeval *timeout) ret = select(fd + 1, &rfds, NULL, NULL, timeout); - if (ret == -1) - fatal("Your system does not support select()ing on pcap devices (%s). PLEASE REPORT THIS ALONG WITH DETAILED SYSTEM INFORMATION TO THE nmap-dev MAILING LIST!", strerror(errno)); + if (ret == -1) { + if (errno == EINTR) + goto again; + else + fatal("Your system does not support select()ing on pcap devices (%s). PLEASE REPORT THIS ALONG WITH DETAILED SYSTEM INFORMATION TO THE nmap-dev MAILING LIST!", strerror(errno)); + } while (errno == EINTR); return ret; }