summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2013-08-22 16:46:17 +0200
committerPaul Smith <psmith@gnu.org>2013-09-14 20:38:06 -0400
commitab78cbc71ce16dd39e4b6b9e42c02f75bf1d8a50 (patch)
tree98acbcad59538b0f2925c64d8c2438c958856117 /function.c
parentc5bfa400448a14f4c8d4fc51dd56ea17176e1f84 (diff)
downloadgunmake-ab78cbc71ce16dd39e4b6b9e42c02f75bf1d8a50.tar.gz
[SV 39851] Reinstate stack size limit for processes spawned via $(shell)
Diffstat (limited to 'function.c')
-rw-r--r--function.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/function.c b/function.c
index 40e1098..4ea2446 100644
--- a/function.c
+++ b/function.c
@@ -1718,7 +1718,14 @@ func_shell_base (char *o, char **argv, int trim_newlines)
if (pid < 0)
perror_with_name (error_prefix, "fork");
else if (pid == 0)
- child_execute_job (0, pipedes[1], command_argv, envp);
+ {
+#ifdef SET_STACK_SIZE
+ /* Reset limits, if necessary. */
+ if (stack_limit.rlim_cur)
+ setrlimit (RLIMIT_STACK, &stack_limit);
+#endif
+ child_execute_job (0, pipedes[1], command_argv, envp);
+ }
else
# endif
#endif