summaryrefslogtreecommitdiff
path: root/miscutils/time.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-01-02 18:49:22 +0100
committerDenys Vlasenko2010-01-02 18:49:22 +0100
commitc066472b0cfba62260ccb86d567a11c8b3d395e3 (patch)
tree7e7827ab2a317eebeb1add39179790c62bc34e4f /miscutils/time.c
parent1ee5afdce28d5a11987071f710c1d2fd493618cc (diff)
downloadbusybox-c066472b0cfba62260ccb86d567a11c8b3d395e3.zip
busybox-c066472b0cfba62260ccb86d567a11c8b3d395e3.tar.gz
*: 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>
Diffstat (limited to 'miscutils/time.c')
-rw-r--r--miscutils/time.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/miscutils/time.c b/miscutils/time.c
index 42c812a..3421736 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -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))