refactor getrlimit/setrlimit code

This commit is contained in:
Pavel Odintsov 2014-06-22 23:04:43 +04:00
parent 6e2987c96f
commit 55d1ebfcf3
2 changed files with 7 additions and 1 deletions

Binary file not shown.

View File

@ -678,10 +678,16 @@ bool load_configuration_file() {
}
}
/* Enable core dumps for simplify debug tasks */
void enable_core_dumps() {
struct rlimit rlim;
if (!getrlimit(RLIMIT_CORE, &rlim)) {
int result = getrlimit(RLIMIT_CORE, &rlim);
if (result) {
std::cout<<"Can't get current rlimit for RLIMIT_CORE"<<endl;
return;
} else {
rlim.rlim_cur = rlim.rlim_max;
setrlimit(RLIMIT_CORE, &rlim);
}