]> granicus.if.org Git - libevent/commitdiff
solaris kernel changes are not backwards compatible - how retarded. problem
authorNiels Provos <provos@gmail.com>
Sat, 12 Nov 2005 19:04:17 +0000 (19:04 +0000)
committerNiels Provos <provos@gmail.com>
Sat, 12 Nov 2005 19:04:17 +0000 (19:04 +0000)
pointed out by: Geoffrey Giesemann

svn:r185

epoll.c

diff --git a/epoll.c b/epoll.c
index 9f1066d8618eff1d63c5d62e968d1a89c75489da..bdab078bf7f65cc43b6a65d3c451620b0c1bffd5 100644 (file)
--- a/epoll.c
+++ b/epoll.c
@@ -109,8 +109,14 @@ epoll_init(void)
                return (NULL);
 
        if (getrlimit(RLIMIT_NOFILE, &rl) == 0 &&
-           rl.rlim_cur != RLIM_INFINITY)
-               nfiles = rl.rlim_cur;
+           rl.rlim_cur != RLIM_INFINITY) {
+               /*
+                * Solaris is somewhat retarded - it's important to drop
+                * backwards compatibility when making changes.  So, don't
+                * dare to put rl.rlim_cur here.
+                */
+               nfiles = rl.rlim_cur - 1;
+       }
 
        /* Initalize the kernel queue */