summaryrefslogtreecommitdiff
path: root/job.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-10-01 18:26:28 +0300
committerEli Zaretskii <eliz@gnu.org>2014-10-01 18:26:28 +0300
commit86a058029beb8c5516eed4293de2a8b9131f3438 (patch)
treef4ff15f06cdbb0eb4439b863b07f0eced1444cae /job.c
parent0a3a0756b987e2f7f06322de746c3da5fef4c9ed (diff)
downloadgunmake-86a058029beb8c5516eed4293de2a8b9131f3438.tar.gz
Treat redirection of standard handles on Windows as it is done on Unix.
* job.c (start_job_command) [WINDOWS32]: Compute outfd and errfd as on Posix platforms, and pass the results to process_easy. * function.c (windows32_openpipe) [WINDOWS32]: Accept an additional argument ERRFD and use it for redirecting the standard error handle passed to the subprocess. (func_shell_base) [WINDOWS32]: Pass the computed errfd to windows32_openpipe.
Diffstat (limited to 'job.c')
-rw-r--r--job.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/job.c b/job.c
index cb10f64..d22e26c 100644
--- a/job.c
+++ b/job.c
@@ -1639,14 +1639,18 @@ start_job_command (struct child *child)
sync_Path_environment ();
#ifndef NO_OUTPUT_SYNC
- /* Divert child output if output_sync in use. Don't capture
- recursive make output unless we are synchronizing "make" mode. */
- if (child->output.syncout)
- hPID = process_easy (argv, child->environment,
- child->output.out, child->output.err);
- else
+ /* Divert child output if output_sync in use. */
+ if (child->output.syncout)
+ {
+ if (child->output.out >= 0)
+ outfd = child->output.out;
+ if (child->output.err >= 0)
+ errfd = child->output.err;
+ }
+#else
+ outfd = errfd = -1;
#endif
- hPID = process_easy (argv, child->environment, -1, -1);
+ hPID = process_easy (argv, child->environment, outfd, errfd);
if (hPID != INVALID_HANDLE_VALUE)
child->pid = (pid_t) hPID;