diff --git a/NEWS b/NEWS index b197082b..6a934ded 100644 --- a/NEWS +++ b/NEWS @@ -73,6 +73,7 @@ NEWS * [mod_status] table w/ count of con states (fixes #2427) * [mod_dirlisting] class for dir (fixes #2304) * [core] define __STDC_WANT_LIB_EXT1__ (fixes #2722) + * [core] setrlimit max-fds <= rlim_max for non-root (fixes #2723) - 1.4.39 - 2016-01-02 * [core] fix memset_s call (fixes #2698) diff --git a/src/server.c b/src/server.c index 61d850c3..7aacf2e0 100644 --- a/src/server.c +++ b/src/server.c @@ -954,9 +954,9 @@ int main (int argc, char **argv) { } /** - * we are not root can can't increase the fd-limit, but we can reduce it + * we are not root can can't increase the fd-limit above rlim_max, but we can reduce it */ - if (srv->srvconf.max_fds && srv->srvconf.max_fds < rlim.rlim_cur) { + if (srv->srvconf.max_fds && srv->srvconf.max_fds <= rlim.rlim_max) { /* set rlimits */ rlim.rlim_cur = srv->srvconf.max_fds;