1
1

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.
Этот коммит содержится в:
Terry Dontje 2010-02-17 14:50:37 +00:00
родитель 1ce37bc5ce
Коммит 2a4b1227d9
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -144,7 +144,7 @@ devpoll_init(struct event_base *base)
if (getrlimit(RLIMIT_NOFILE, &rl) == 0 && if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
rl.rlim_cur != RLIM_INFINITY) rl.rlim_cur != RLIM_INFINITY)
nfiles = rl.rlim_cur; nfiles = rl.rlim_cur - 1;
/* Initialize the kernel queue */ /* Initialize the kernel queue */
if ((dpfd = open("/dev/poll", O_RDWR)) == -1) { 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; struct devpollop *devpollop = arg;
if (max >= devpollop->nfds) { if (max > devpollop->nfds) {
struct evdevpoll *fds; struct evdevpoll *fds;
int nfds; int nfds;
nfds = devpollop->nfds; nfds = devpollop->nfds;
while (nfds <= max) while (nfds < max)
nfds <<= 1; nfds <<= 1;
fds = realloc(devpollop->fds, nfds * sizeof(struct evdevpoll)); 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; struct epollop *epollop = arg;
if (max >= epollop->nfds) { if (max > epollop->nfds) {
struct evepoll *fds; struct evepoll *fds;
int nfds; int nfds;
nfds = epollop->nfds; nfds = epollop->nfds;
while (nfds <= max) while (nfds < max)
nfds <<= 1; nfds <<= 1;
fds = realloc(epollop->fds, nfds * sizeof(struct evepoll)); fds = realloc(epollop->fds, nfds * sizeof(struct evepoll));