diff --git a/nsock/src/nsock_core.c b/nsock/src/nsock_core.c index 1b943e94a..45ba6ea81 100644 --- a/nsock/src/nsock_core.c +++ b/nsock/src/nsock_core.c @@ -112,7 +112,9 @@ void update_first_events(msevent *nse); int socket_count_zero(msiod *iod, mspool *ms) { iod->readsd_count = 0; iod->writesd_count = 0; +#if HAVE_PCAP iod->readpcapsd_count = 0; +#endif return ms->engine->iod_unregister(ms, iod); } @@ -187,11 +189,11 @@ static void update_events(msiod * iod, mspool *ms, int ev_inc, int ev_dec) { setmask = ev_inc; clrmask = EV_NONE; - if ((ev_dec & EV_READ) && (!iod->readsd_count + if ((ev_dec & EV_READ) && (!iod->readsd_count) #if HAVE_PCAP - && !iod->readpcapsd_count) + && (!iod->readpcapsd_count) #endif - ) + ) clrmask |= EV_READ; if ((ev_dec & EV_WRITE) && (!iod->writesd_count)) diff --git a/nsock/src/nsock_iod.c b/nsock/src/nsock_iod.c index 0514bd474..6ddb486bd 100644 --- a/nsock/src/nsock_iod.c +++ b/nsock/src/nsock_iod.c @@ -113,11 +113,10 @@ nsock_iod nsi_new2(nsock_pool nsockp, int sd, void *userdata) { nsi->first_write = NULL; #if HAVE_PCAP nsi->first_pcap_read = NULL; + nsi->readpcapsd_count = 0; #endif - nsi->readsd_count = 0; nsi->write_count = 0; - nsi->readpcapsd_count = 0; nsi->userdata = userdata; nsi->nsp = (mspool *)nsockp;