Make --no-stack-rlimit the first argument

fixes #6765
This commit is contained in:
Gunnar Beutner 2014-08-06 10:35:27 +02:00
parent 089fdb1b20
commit 89b94ab8ab
1 changed files with 6 additions and 5 deletions

View File

@ -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)