mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
Add check on num fds
This commit is contained in:
parent
d155a0cf6d
commit
c1de185d2c
1 changed files with 5 additions and 0 deletions
|
|
@ -6045,6 +6045,11 @@ int Utils::pollSocket(int sock, int timeout /* msec */) {
|
|||
fd_set rset;
|
||||
struct timeval tv;
|
||||
|
||||
if (sock > FD_SETSIZE) {
|
||||
ntop->getTrace()->traceEvent(TRACE_WARNING, "Unable to poll socket %d (too many file descriptors)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
FD_ZERO(&rset);
|
||||
FD_SET(sock, &rset);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue