diff options
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/callproc.c b/src/callproc.c index bce5b505df3..9bf6d23b9ac 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -646,8 +646,13 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 646 | started with its standard in, out, or error closed, as might | 646 | started with its standard in, out, or error closed, as might |
| 647 | happen under X. */ | 647 | happen under X. */ |
| 648 | in = relocate_fd (in, 3); | 648 | in = relocate_fd (in, 3); |
| 649 | out = relocate_fd (out, 3); | 649 | if (out == err) |
| 650 | err = relocate_fd (err, 3); | 650 | err = out = relocate_fd (out, 3); |
| 651 | else | ||
| 652 | { | ||
| 653 | out = relocate_fd (out, 3); | ||
| 654 | err = relocate_fd (err, 3); | ||
| 655 | } | ||
| 651 | 656 | ||
| 652 | close (0); | 657 | close (0); |
| 653 | close (1); | 658 | close (1); |