Merge pull request #6119 from tclh123/dev

fixup set rlimit stack failed condition
This commit is contained in:
Jean Flach 2018-03-21 09:56:47 +01:00 committed by GitHub
commit 92f7242db1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -255,9 +255,9 @@ void Application::SetResourceLimits()
else
rl.rlim_cur = rl.rlim_max;
if (setrlimit(RLIMIT_STACK, &rl) < 0)
if (setrlimit(RLIMIT_STACK, &rl) < 0) {
Log(LogNotice, "Application", "Could not adjust resource limit for stack size (RLIMIT_STACK)");
else if (set_stack_rlimit) {
if (set_stack_rlimit) {
char **new_argv = static_cast<char **>(malloc(sizeof(char *) * (argc + 2)));
if (!new_argv) {
@ -282,6 +282,7 @@ void Application::SetResourceLimits()
perror("execvp");
_exit(EXIT_FAILURE);
}
}
# else /* RLIMIT_STACK */
Log(LogNotice, "Application", "System does not support adjusting the resource limit for stack size (RLIMIT_STACK)");
# endif /* RLIMIT_STACK */