diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-11 12:36:37 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-11 12:36:37 +0000 |
commit | f4046a61e7fb5e017a19a0308bfa42fa5abe68d5 (patch) | |
tree | 36b4ef551f8fb0a3c92964770c5d9e1b64ad6d60 /src/inspircd_io.cpp | |
parent | 5f462cf84e2d28df31df7ba081f9f0822cec9e90 (diff) |
Made setrlimit a commandline option
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1042 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd_io.cpp')
-rw-r--r-- | src/inspircd_io.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index fca22e3be..00842b697 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -33,6 +33,7 @@ extern FILE *log_file; extern int boundPortCount; extern int openSockfd[MAXSOCKS]; extern time_t TIME; +extern bool unlimitcore; void WriteOpers(char* text, ...); @@ -126,17 +127,20 @@ int DaemonSeed (void) setpriority(PRIO_PROCESS,(int)getpid(),15); /* ircd sets to low process priority so it doesnt hog the box */ - rlimit rl; - if (getrlimit(RLIMIT_CORE, &rl) == -1) + if (unlimitcore) { - log(DEFAULT,"Failed to getrlimit()!"); - return(FALSE); - } - else - { - rl.rlim_cur = rl.rlim_max; - if (setrlimit(RLIMIT_CORE, &rl) == -1) - log(DEFAULT,"setrlimit() failed, cannot increase coredump size."); + rlimit rl; + if (getrlimit(RLIMIT_CORE, &rl) == -1) + { + log(DEFAULT,"Failed to getrlimit()!"); + return(FALSE); + } + else + { + rl.rlim_cur = rl.rlim_max; + if (setrlimit(RLIMIT_CORE, &rl) == -1) + log(DEFAULT,"setrlimit() failed, cannot increase coredump size."); + } } return (TRUE); |