mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-30 13:00:38 +00:00
Test for overflowing platform FD_SET size.
This commit is contained in:
1 parent
60176c7bf4
commit
f6d6956261
5 files changed
+41
-69
No files matched your search
+16
-3
@@ -570,10 +570,23 @@ char *print_mac(char *buff, unsigned char *mac, int len)
|
||||
return buff;
|
||||
}
|
||||
|
||||
void bump_maxfd(int fd, int *max)
|
||||
void bump_maxfd(fd_set *set, int fd, int *max)
|
||||
{
|
||||
if (fd > *max)
|
||||
*max = fd;
|
||||
#ifdef FD_SETSIZE
|
||||
if (fd >= FD_SETSIZE)
|
||||
{
|
||||
static int logged = 0;
|
||||
if (!logged)
|
||||
my_syslog(LOG_ERR, _("File descriptor overflows FS_SET"));
|
||||
logged = 1;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
FD_SET(fd, set);
|
||||
if (fd > *max)
|
||||
*max = fd;
|
||||
}
|
||||
}
|
||||
|
||||
/* rc is return from sendto and friends.
|
||||
|
||||
Reference in new issue
Block a user