corrected an array access bug in the latest libevent merge (see #2234) that was causing Solaris binaries to loop infinitely.
This commit was SVN r22638.
Этот коммит содержится в:
родитель
1ce37bc5ce
Коммит
2a4b1227d9
@ -144,7 +144,7 @@ devpoll_init(struct event_base *base)
|
||||
|
||||
if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
|
||||
rl.rlim_cur != RLIM_INFINITY)
|
||||
nfiles = rl.rlim_cur;
|
||||
nfiles = rl.rlim_cur - 1;
|
||||
|
||||
/* Initialize the kernel queue */
|
||||
if ((dpfd = open("/dev/poll", O_RDWR)) == -1) {
|
||||
@ -192,12 +192,12 @@ devpoll_recalc(struct event_base *base, void *arg, int max)
|
||||
{
|
||||
struct devpollop *devpollop = arg;
|
||||
|
||||
if (max >= devpollop->nfds) {
|
||||
if (max > devpollop->nfds) {
|
||||
struct evdevpoll *fds;
|
||||
int nfds;
|
||||
|
||||
nfds = devpollop->nfds;
|
||||
while (nfds <= max)
|
||||
while (nfds < max)
|
||||
nfds <<= 1;
|
||||
|
||||
fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll));
|
||||
|
@ -167,12 +167,12 @@ epoll_recalc(struct event_base *base, void *arg, int max)
|
||||
{
|
||||
struct epollop *epollop = arg;
|
||||
|
||||
if (max >= epollop->nfds) {
|
||||
if (max > epollop->nfds) {
|
||||
struct evepoll *fds;
|
||||
int nfds;
|
||||
|
||||
nfds = epollop->nfds;
|
||||
while (nfds <= max)
|
||||
while (nfds < max)
|
||||
nfds <<= 1;
|
||||
|
||||
fds = realloc(epollop->fds, nfds * sizeof(struct evepoll));
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user