mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-11-25 04:35:44 +00:00
Allow the EMX build to use output_sync.
job.c (start_job_command): Move the child output diversion out of non-EMX branch. [__EMX__]: Don't use fixed FD_STDOUT and FD_STDERR in the call to child_execute_job. Copyright-paperwork-exempt: yes
This commit is contained in:
parent
24620378ba
commit
165ccf3137
1 changed files with 13 additions and 14 deletions
27
job.c
27
job.c
|
@ -1145,6 +1145,8 @@ start_job_command (struct child *child)
|
|||
char *argv;
|
||||
#else
|
||||
char **argv;
|
||||
int outfd = FD_STDOUT;
|
||||
int errfd = FD_STDERR;
|
||||
#endif
|
||||
|
||||
/* If we have a completely empty commandset, stop now. */
|
||||
|
@ -1434,6 +1436,16 @@ start_job_command (struct child *child)
|
|||
|
||||
parent_environ = environ;
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
/* 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;
|
||||
}
|
||||
#endif
|
||||
# ifdef __EMX__
|
||||
/* If we aren't running a recursive command and we have a jobserver
|
||||
pipe, close it before exec'ing. */
|
||||
|
@ -1447,7 +1459,7 @@ start_job_command (struct child *child)
|
|||
|
||||
/* Never use fork()/exec() here! Use spawn() instead in exec_command() */
|
||||
child->pid = child_execute_job (child->good_stdin ? FD_STDIN : bad_stdin,
|
||||
FD_STDOUT, FD_STDERR,
|
||||
outfd, errfd,
|
||||
argv, child->environment);
|
||||
if (child->pid < 0)
|
||||
{
|
||||
|
@ -1472,9 +1484,6 @@ start_job_command (struct child *child)
|
|||
environ = parent_environ; /* Restore value child may have clobbered. */
|
||||
if (child->pid == 0)
|
||||
{
|
||||
int outfd = FD_STDOUT;
|
||||
int errfd = FD_STDERR;
|
||||
|
||||
/* We are the child side. */
|
||||
unblock_sigs ();
|
||||
|
||||
|
@ -1493,16 +1502,6 @@ start_job_command (struct child *child)
|
|||
if (stack_limit.rlim_cur)
|
||||
setrlimit (RLIMIT_STACK, &stack_limit);
|
||||
#endif
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
child_execute_job (child->good_stdin ? FD_STDIN : bad_stdin,
|
||||
outfd, errfd, argv, child->environment);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue