aboutsummaryrefslogtreecommitdiff
path: root/console-tools/openvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'console-tools/openvt.c')
-rw-r--r--console-tools/openvt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index 5f244579c..d9f49bbea 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -64,10 +64,8 @@ int openvt_main(int argc, char **argv)
fd = bb_xopen(vtname, O_RDWR);
/* Reassign stdout and sterr */
- close(1);
- close(2);
- dup(fd);
- dup(fd);
+ dup2(fd, STDOUT_FILENO);
+ dup2(fd, STDERR_FILENO);
execvp(argv[0], argv);
_exit(1);