← Commit list

0a3b0106a

Glenn L McGrath
Glenn L McGrath
2003-05-13
FAILED Duration: 74s

Subject

Re-use existing variables, patch from Tito

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

console-tools/openvt.c+5 -7
@@ -3,6 +3,7 @@
* openvt.c - open a vt to run a command.
*
* busyboxed by Quy Tonthat <[email protected]>
+ * hacked by Tito <[email protected]>
*
* 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 openvt_main(int argc, char **argv)
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 @@ int openvt_main(int argc, char **argv)
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 @@ int openvt_main(int argc, char **argv)
dup(fd);
dup(fd);
- execvp(cmd, &argv[2]);
- /*execlp(cmd, cmd_args);*/
+ execvp(argv[0], argv);
_exit(1);
}
return EXIT_SUCCESS;