svn commit: trunk/busybox: console-tools findutils miscutils

aldot at busybox.net aldot at busybox.net
Sat May 27 09:36:44 UTC 2006


Author: aldot
Date: 2006-05-27 02:36:43 -0700 (Sat, 27 May 2006)
New Revision: 15200

Log:
- use the defines CURRENT_TTY and VC_1; also shrink xargs a tiny bit:
add/remove: 0/0 grow/shrink: 2/6 up/down: 5/-37 (-32)
function                                     old     new   delta
static.add_interface                         271     274      +3
static.glob3                                  36      38      +2
static.renice_main                           409     408      -1
static.readcmd                              1083    1081      -2
static.changepath                            176     174      -2
static.parse_opts                             56      51      -5
static.rx_main                              1095    1088      -7
static.xargs_main                            759     739     -20
----------------------------------------------------------------
Result                                                :-)    -32



Modified:
   trunk/busybox/console-tools/setlogcons.c
   trunk/busybox/findutils/xargs.c
   trunk/busybox/miscutils/rx.c


Changeset:
Modified: trunk/busybox/console-tools/setlogcons.c
===================================================================
--- trunk/busybox/console-tools/setlogcons.c	2006-05-26 23:44:51 UTC (rev 15199)
+++ trunk/busybox/console-tools/setlogcons.c	2006-05-27 09:36:43 UTC (rev 15200)
@@ -27,7 +27,7 @@
 	if (argc == 2)
 		arg.subarg = atoi(argv[1]);
 
-	if (ioctl(bb_xopen("/dev/tty1", O_RDONLY), TIOCLINUX, &arg))
+	if (ioctl(bb_xopen(VC_1, O_RDONLY), TIOCLINUX, &arg))
 		bb_perror_msg_and_die("TIOCLINUX");;
 
 	return 0;

Modified: trunk/busybox/findutils/xargs.c
===================================================================
--- trunk/busybox/findutils/xargs.c	2006-05-26 23:44:51 UTC (rev 15199)
+++ trunk/busybox/findutils/xargs.c	2006-05-27 09:36:43 UTC (rev 15200)
@@ -311,9 +311,7 @@
 	int c, savec;
 
 	if (!tty_stream) {
-		tty_stream = fopen("/dev/tty", "r");
-		if (!tty_stream)
-			bb_perror_msg_and_die("/dev/tty");
+		tty_stream = bb_xfopen(CURRENT_TTY, "r");
 		/* pranoidal security by vodz */
 		fcntl(fileno(tty_stream), F_SETFD, FD_CLOEXEC);
 	}

Modified: trunk/busybox/miscutils/rx.c
===================================================================
--- trunk/busybox/miscutils/rx.c	2006-05-26 23:44:51 UTC (rev 15199)
+++ trunk/busybox/miscutils/rx.c	2006-05-27 09:36:43 UTC (rev 15200)
@@ -290,7 +290,7 @@
 			bb_show_usage();
 
 	fn = argv[1];
-	ttyfd = bb_xopen3("/dev/tty", O_RDWR, 0);
+	ttyfd = bb_xopen3(CURRENT_TTY, O_RDWR, 0);
 	filefd = bb_xopen3(fn, O_RDWR|O_CREAT|O_TRUNC, 0666);
 
 	if (tcgetattr(ttyfd, &tty) < 0)




More information about the busybox-cvs mailing list