--- src/server.c.orig 2015-03-31 03:56:28.000000000 -0700
+++ src/server.c 2015-05-05 02:17:22.000000000 -0700
#include <sys/resource.h>
+#include <sys/syslimits.h>
if (pthread_atfork (NULL, NULL, atfork_child_restore_rlimit_nofile) != 0)
- l.rlim_cur = l.rlim_max = sv_rlimit_nofile.rlim_max;
+ l.rlim_cur = l.rlim_max = MIN(OPEN_MAX, sv_rlimit_nofile.rlim_max);
if (setrlimit (RLIMIT_NOFILE, &l) < 0)
if (!increase_rlimit_nofile ()) {
- g_printerr ("Failed to increase RLIMIT_NOFILE: %m\n");
+ g_printerr ("Failed to increase RLIMIT_NOFILE: %s\n", strerror(errno));
/* Now we can create the app */