Blob Blame History Raw
From 552207b506f4d98a6a5f73053aa6bd924758708f Mon Sep 17 00:00:00 2001
From: Petr Machata <pmachata@redhat.com>
Date: Thu, 22 Aug 2013 16:46:17 +0200
Subject: [PATCH] Get rid of stack size limit for processes spawned via
 $(shell)

---
 ChangeLog  |    5 +++++
 function.c |   10 +++++++++-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/function.c b/function.c
index 9eabd73..e121b9a 100644
--- a/function.c
+++ b/function.c
@@ -1715,7 +1715,15 @@ 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
-- 
1.7.6.5