libevent changes diff -r 36e71ea5d92f opal/event/devpoll.c --- a/opal/event/devpoll.c Wed May 19 11:22:01 2010 +0200 +++ b/opal/event/devpoll.c Fri Jun 04 11:36:52 2010 +0200 @@ -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 - 1; + nfiles = rl.rlim_cur; /* Initialize the kernel queue */ if ((dpfd = open("/dev/poll", O_RDWR)) == -1) { @@ -192,12 +192,12 @@ devpoll_recalc(struct event_base *base, { 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)); diff -r 36e71ea5d92f opal/event/epoll.c --- a/opal/event/epoll.c Wed May 19 11:22:01 2010 +0200 +++ b/opal/event/epoll.c Fri Jun 04 11:36:52 2010 +0200 @@ -167,12 +167,12 @@ epoll_recalc(struct event_base *base, vo { 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));