[BusyBox-cvs] busybox/console-tools openvt.c,1.4,1.5

Glenn McGrath bug1 at busybox.net
Tue May 13 16:31:19 UTC 2003


Update of /var/cvs/busybox/console-tools
In directory winder:/tmp/cvs-serv8272/console-tools

Modified Files:
	openvt.c 
Log Message:
Re-use existing variables, patch from Tito


Index: openvt.c
===================================================================
RCS file: /var/cvs/busybox/console-tools/openvt.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- openvt.c	19 Mar 2003 09:11:29 -0000	1.4
+++ openvt.c	13 May 2003 16:31:15 -0000	1.5
@@ -3,6 +3,7 @@
  *  openvt.c - open a vt to run a command.
  *
  *  busyboxed by Quy Tonthat <quy at signal3.com>
+ *  hacked by Tito <farmatito at tiscali.it>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -39,8 +40,7 @@
 	int fd;
 	int vtno;
 	char vtname[sizeof VTNAME + 2];
-	char * cmd = NULL;
-	char * cmd_args = NULL;
+
 
 	if (argc < 3)
         bb_show_usage();
@@ -56,9 +56,8 @@
 
 	sprintf(vtname, VTNAME, vtno);
 
-	cmd = argv[2];
-	cmd_args = xmalloc(80);
-	cmd_args[0] = '\0';
+	argv+=2;
+	argc-=2;
 
 	if((pid = fork()) == 0) {
 		/* leave current vt */
@@ -83,8 +82,7 @@
 		dup(fd);
 		dup(fd);
 
-		execvp(cmd, &argv[2]);
-		/*execlp(cmd, cmd_args);*/
+		execvp(argv[0], argv);
 		_exit(1);
 	}
 	return EXIT_SUCCESS;



More information about the busybox-cvs mailing list