From: Gunnar Beutner Date: Wed, 6 Aug 2014 08:35:27 +0000 (+0200) Subject: Make --no-stack-rlimit the first argument X-Git-Tag: v2.0.2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=89b94ab8ab4eb561dd9ab0264bb2ed415b190f92;p=icinga2 Make --no-stack-rlimit the first argument fixes #6765 --- diff --git a/lib/base/application.cpp b/lib/base/application.cpp index d17415164..1962eaa94 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -208,16 +208,17 @@ void Application::SetResourceLimits(void) exit(1); } - for (int i = 0; i < argc; i++) - new_argv[i] = argv[i]; + new_argv[0] = argv[0]; + new_argv[1] = strdup("--no-stack-rlimit"); - new_argv[argc] = strdup("--no-stack-rlimit"); - - if (!new_argv[argc]) { + if (!new_argv[1]) { perror("strdup"); exit(1); } + for (int i = 1; i < argc; i++) + new_argv[i + 1] = argv[i]; + new_argv[argc + 1] = NULL; if (execvp(new_argv[0], new_argv) < 0)