summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath2004-01-13 10:12:16 +0000
committerGlenn L McGrath2004-01-13 10:12:16 +0000
commitdfb6211df36207a62ae39b9d3c670bb0dc1ebbd5 (patch)
tree707fccc2fd08aa5688f8632c5a35e61fe0239929
parent447bc2d17f3abfac1f0f1a801d01641aada7027c (diff)
downloadbusybox-dfb6211df36207a62ae39b9d3c670bb0dc1ebbd5.zip
busybox-dfb6211df36207a62ae39b9d3c670bb0dc1ebbd5.tar.gz
Patch by Tito, remove some unneeded variables to save some space.
-rw-r--r--console-tools/openvt.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index bafd1d0..b0db33b 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -32,31 +32,22 @@
#include "busybox.h"
-#define VTNAME "/dev/tty%d"
-
int openvt_main(int argc, char **argv)
{
- int pid;
int fd;
- int vtno;
- char vtname[sizeof VTNAME + 2];
+ char vtname[sizeof VC_FORMAT + 2];
if (argc < 3)
bb_show_usage();
- if (!isdigit(argv[1][0]))
- bb_show_usage();
-
- /* check for Illegal vt number */
- vtno=bb_xgetlarg(argv[1], 10, 1, 12);
-
- sprintf(vtname, VTNAME, vtno);
+ /* check for Illegal vt number: < 1 or > 12 */
+ sprintf(vtname, VC_FORMAT,(int)bb_xgetlarg(argv[1], 10, 1, 12));
argv+=2;
argc-=2;
- if((pid = fork()) == 0) {
+ if(fork() == 0) {
/* leave current vt */
#ifdef ESIX_5_3_2_D