diff options
Diffstat (limited to 'daemon/logind')
-rw-r--r-- | daemon/logind/logind.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/daemon/logind/logind.c b/daemon/logind/logind.c index c5939a9f..017bede8 100644 --- a/daemon/logind/logind.c +++ b/daemon/logind/logind.c @@ -19,6 +19,7 @@ #include <unistd.h> #include <sys/time.h> #include <sys/types.h> +#include <sys/resource.h> #include <signal.h> #include <event.h> @@ -49,6 +50,10 @@ #define MAX_TEXT_SCREEN_LINES (24) +#ifndef MAX_FDS +#define MAX_FDS (100000) +#endif + /////////////////////////////////////////////////////////////////////// // global variables int g_tunnel; // tunnel for service daemon @@ -1272,6 +1277,9 @@ main(int argc, char *argv[]) } } + struct rlimit r = {.rlim_cur = MAX_FDS, .rlim_max = MAX_FDS}; + setrlimit(RLIMIT_NOFILE, &r); + chdir(BBSHOME); attach_SHM(); |