mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 08:59:01 +00:00
Reduce CPU consumption with nsock engine poll
Entering nsock_loop() with the poll engine activated and no registered FD (timers only, for instance) should not directly return, but sleep until next timeout.
This commit is contained in:
@@ -347,11 +347,7 @@ int poll_loop(struct npool *nsp, int msec_timeout) {
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
if (pinfo->max_fd > -1)
|
||||
results_left = Poll(pinfo->events, pinfo->max_fd + 1, combined_msecs);
|
||||
else
|
||||
results_left = 0;
|
||||
|
||||
results_left = Poll(pinfo->events, pinfo->max_fd + 1, combined_msecs);
|
||||
if (results_left == -1)
|
||||
sock_err = socket_errno();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user