diff options
Diffstat (limited to 'select.c')
-rw-r--r-- | select.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -234,11 +234,14 @@ select_add(struct event_base *base, int fd, short old, short events, void *p) if (sop->event_fds < fd) { int fdsz = sop->event_fdsz; - if (fdsz < sizeof(fd_mask)) - fdsz = sizeof(fd_mask); + if (fdsz < (int)sizeof(fd_mask)) + fdsz = (int)sizeof(fd_mask); + /* In theory we should worry about overflow here. In + * reality, though, the highest fd on a unixy system will + * not overflow here. XXXX */ while (fdsz < - (howmany(fd + 1, NFDBITS) * sizeof(fd_mask))) + (int) (howmany(fd + 1, NFDBITS) * sizeof(fd_mask))) fdsz *= 2; if (fdsz != sop->event_fdsz) { |