From 9cd01958da86a68d0e47defcb9745ab373ef3d79 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 21 Sep 2013 15:23:05 -0400 Subject: Ensure that stderr from shell functions in recipes is synced. --- function.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'function.c') diff --git a/function.c b/function.c index 4ea2446..866ac48 100644 --- a/function.c +++ b/function.c @@ -1710,7 +1710,7 @@ func_shell_base (char *o, char **argv, int trim_newlines) CLOSE_ON_EXEC(pipedes[1]); CLOSE_ON_EXEC(pipedes[0]); /* Never use fork()/exec() here! Use spawn() instead in exec_command() */ - pid = child_execute_job (0, pipedes[1], command_argv, envp); + pid = child_execute_job (FD_STDIN, pipedes[1], FD_STDOUT, command_argv, envp); if (pid < 0) perror_with_name (error_prefix, "spawn"); # else /* ! __EMX__ */ @@ -1719,12 +1719,14 @@ func_shell_base (char *o, char **argv, int trim_newlines) perror_with_name (error_prefix, "fork"); else if (pid == 0) { -#ifdef SET_STACK_SIZE +# 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); +# endif + child_execute_job (FD_STDIN, pipedes[1], + output_context ? output_context->err : FD_STDERR, + command_argv, envp); } else # endif -- cgit v1.2.3