diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-13 12:08:16 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-13 12:08:16 +0000 |
commit | 70baba940fb33e1016ed8d5370bc524410b83a52 (patch) | |
tree | cb713af9d77af347bbdd24b7ec24665cd2b507a3 /crawl-ref/source/libunix.cc | |
parent | 07d376f8e8884020c0ba45ad76bb419d2d89b600 (diff) | |
download | crawl-ref-70baba940fb33e1016ed8d5370bc524410b83a52.tar.gz crawl-ref-70baba940fb33e1016ed8d5370bc524410b83a52.zip |
Trunk->0.4 r6912: Enable core dumps automatically for dgamelaunch builds (-DDGL_ENABLE_CORE_DUMP) to make it easier to track down crashes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6913 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libunix.cc')
-rw-r--r-- | crawl-ref/source/libunix.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc index cd84a7a282..b79b7da691 100644 --- a/crawl-ref/source/libunix.cc +++ b/crawl-ref/source/libunix.cc @@ -51,6 +51,11 @@ #include "stuff.h" #include "view.h" +#ifdef DGL_ENABLE_CORE_DUMP +#include <sys/time.h> +#include <sys/resource.h> +#endif + #ifdef UNICODE_GLYPHS #include <wchar.h> #include <locale.h> @@ -447,6 +452,14 @@ void unixcurses_startup( void ) #endif +#ifdef DGL_ENABLE_CORE_DUMP + rlimit lim; + if (!getrlimit(RLIMIT_CORE, &lim)) { + lim.rlim_cur = RLIM_INFINITY; + setrlimit(RLIMIT_CORE, &lim); + } +#endif + initscr(); raw(); noecho(); |