summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-16 12:41:33 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-16 12:41:33 +0000
commit80de50711e88bf73c680a82bd22db58a6ac25265 (patch)
treed4316166390fac60bd18ef5b30de068124bf05f4 /src
parent43bad5d4ae97c88e06e6d271e5421dd7a1102cff (diff)
Make DumpCore actually do something again.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2090 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 29a6bd132..7c76674e8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -32,6 +32,11 @@
#include "datafiles.h"
#include "modules.h"
+// getrlimit.
+#include <sys/time.h>
+#include <sys/resource.h>
+
+
/******** Global variables! ********/
/* Command-line options: (note that configuration variables are in config.c) */
@@ -409,6 +414,25 @@ int main(int ac, char **av, char **envp)
started = 1;
+#ifndef _WIN32
+ if (DumpCore)
+ {
+ rlimit rl;
+ if (getrlimit(RLIMIT_CORE, &rl) == -1)
+ {
+ alog("Failed to getrlimit()!");
+ }
+ else
+ {
+ rl.rlim_cur = rl.rlim_max;
+ if (setrlimit(RLIMIT_CORE, &rl) == -1)
+ {
+ alog("setrlimit() failed, cannot increase coredump size");
+ }
+ }
+ }
+#endif
+
/*** Main loop. ***/
while (!quitting) {