mirror of
https://github.com/anope/anope.git
synced 2026-07-06 10:13:14 +02:00
Make DumpCore actually do something again.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2090 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
+24
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user