summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-05-13 16:31:15 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-05-13 16:31:15 +0000
commit0a3b0106ab62950a3486ca33a7e3c9ee6d0e0fca (patch)
tree6bd130f59f28bcf520a1c53c1b69b8c94d57e192
parentc9163fee91e6226d079b27042825ee6e93a25b8b (diff)
downloadbusybox-w32-0a3b0106ab62950a3486ca33a7e3c9ee6d0e0fca.tar.gz
busybox-w32-0a3b0106ab62950a3486ca33a7e3c9ee6d0e0fca.tar.bz2
busybox-w32-0a3b0106ab62950a3486ca33a7e3c9ee6d0e0fca.zip
Re-use existing variables, patch from Tito
-rw-r--r--console-tools/openvt.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index 519513623..269dfc01a 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -3,6 +3,7 @@
3 * openvt.c - open a vt to run a command. 3 * openvt.c - open a vt to run a command.
4 * 4 *
5 * busyboxed by Quy Tonthat <quy@signal3.com> 5 * busyboxed by Quy Tonthat <quy@signal3.com>
6 * hacked by Tito <farmatito@tiscali.it>
6 * 7 *
7 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -39,8 +40,7 @@ int openvt_main(int argc, char **argv)
39 int fd; 40 int fd;
40 int vtno; 41 int vtno;
41 char vtname[sizeof VTNAME + 2]; 42 char vtname[sizeof VTNAME + 2];
42 char * cmd = NULL; 43
43 char * cmd_args = NULL;
44 44
45 if (argc < 3) 45 if (argc < 3)
46 bb_show_usage(); 46 bb_show_usage();
@@ -56,9 +56,8 @@ int openvt_main(int argc, char **argv)
56 56
57 sprintf(vtname, VTNAME, vtno); 57 sprintf(vtname, VTNAME, vtno);
58 58
59 cmd = argv[2]; 59 argv+=2;
60 cmd_args = xmalloc(80); 60 argc-=2;
61 cmd_args[0] = '\0';
62 61
63 if((pid = fork()) == 0) { 62 if((pid = fork()) == 0) {
64 /* leave current vt */ 63 /* leave current vt */
@@ -83,8 +82,7 @@ int openvt_main(int argc, char **argv)
83 dup(fd); 82 dup(fd);
84 dup(fd); 83 dup(fd);
85 84
86 execvp(cmd, &argv[2]); 85 execvp(argv[0], argv);
87 /*execlp(cmd, cmd_args);*/
88 _exit(1); 86 _exit(1);
89 } 87 }
90 return EXIT_SUCCESS; 88 return EXIT_SUCCESS;