summaryrefslogtreecommitdiff
path: root/console-tools/openvt.c
diff options
context:
space:
mode:
Diffstat (limited to 'console-tools/openvt.c')
-rw-r--r--console-tools/openvt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index ff16953..39b9859 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -27,9 +27,10 @@ int openvt_main(int argc, char **argv)
/* grab new one */
close(0);
xopen(vtname, O_RDWR);
- dup2(0, STDOUT_FILENO);
- dup2(0, STDERR_FILENO);
+ xdup2(0, STDOUT_FILENO);
+ xdup2(0, STDERR_FILENO);
- BB_EXECVP(argv[2], &argv[2]);
+ argv += 2;
+ BB_EXECVP(argv[0], argv);
_exit(1);
}