*: do not assign to stdout/stderr, it's not portable.

Based on patch by Aaron Carroll <xaaronc@gmail.com>

function                                             old     new   delta
time_main                                           1062    1052     -10
cpio_main                                            563     549     -14

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-01-02 18:49:22 +01:00
parent 1ee5afdce2
commit c066472b0c
3 changed files with 3 additions and 11 deletions

View File

@ -414,9 +414,7 @@ int time_main(int argc UNUSED_PARAM, char **argv)
run_command(argv, &res);
/* Cheat. printf's are shorter :) */
/* (but see bb_putchar() body for additional wrinkle!) */
xdup2(2, 1); /* just in case libc does something silly :( */
stdout = stderr;
xdup2(STDERR_FILENO, STDOUT_FILENO);
summarize(output_format, argv, &res);
if (WIFSTOPPED(res.waitstatus))