1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-18 21:49:01 +00:00

[NSOCK] Sandwitched pcap_read_on_nonselect() statements between #ifndef

PCAP_CAN_DO_SELECT guards to prevent them from being executed on systems that
actually provide selectable pcap descriptors.
This commit is contained in:
henri
2012-07-17 16:38:15 +00:00
parent db594ed246
commit a111b5bcdc
2 changed files with 8 additions and 0 deletions

View File

@@ -126,8 +126,10 @@ void process_event(mspool *nsp, gh_list *evlist, msevent *nse, int ev);
void process_iod_events(mspool *nsp, msiod *nsi, int ev);
#if HAVE_PCAP
#ifndef PCAP_CAN_DO_SELECT
int pcap_read_on_nonselect(mspool *nsp);
#endif
#endif
/* defined in nsock_event.c */
void update_first_events(msevent *nse);
@@ -315,11 +317,13 @@ int select_loop(mspool *nsp, int msec_timeout) {
}
#if HAVE_PCAP
#ifndef PCAP_CAN_DO_SELECT
/* do non-blocking read on pcap devices that doesn't support select()
* If there is anything read, just leave this loop. */
if (pcap_read_on_nonselect(nsp)) {
/* okay, something was read. */
} else
#endif
#endif
{
/* Set up the descriptors for select */