[BusyBox-cvs] busybox/console-tools dumpkmap.c, 1.16, 1.17 loadacm.c, 1.23, 1.24 loadfont.c, 1.20, 1.21 openvt.c, 1.5, 1.6

Glenn McGrath bug1 at busybox.net
Sat Dec 20 06:00:11 UTC 2003


Update of /var/cvs/busybox/console-tools
In directory nail:/tmp/cvs-serv3216/console-tools

Modified Files:
	dumpkmap.c loadacm.c loadfont.c openvt.c 
Log Message:
Use bb_xopen


Index: dumpkmap.c
===================================================================
RCS file: /var/cvs/busybox/console-tools/dumpkmap.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- dumpkmap.c	19 Mar 2003 09:11:28 -0000	1.16
+++ dumpkmap.c	20 Dec 2003 06:00:08 -0000	1.17
@@ -51,11 +51,7 @@
 		bb_show_usage();
 	}
 
-	fd = open(CURRENT_VC, O_RDWR);
-	if (fd < 0) {
-		bb_perror_msg("Error opening " CURRENT_VC);
-		return EXIT_FAILURE;
-	}
+	fd=bb_xopen(CURRENT_VC, O_RDWR);
 
 	write(1, magic, 7);
 

Index: loadfont.c
===================================================================
RCS file: /var/cvs/busybox/console-tools/loadfont.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- loadfont.c	19 Mar 2003 09:11:29 -0000	1.20
+++ loadfont.c	20 Dec 2003 06:00:08 -0000	1.21
@@ -46,9 +46,7 @@
 	if (argc != 1)
 		bb_show_usage();
 
-	fd = open(CURRENT_VC, O_RDWR);
-	if (fd < 0)
-		bb_perror_msg_and_die("Error opening " CURRENT_VC);
+	fd = bb_xopen(CURRENT_VC, O_RDWR);
 	loadnewfont(fd);
 
 	return EXIT_SUCCESS;

Index: loadacm.c
===================================================================
RCS file: /var/cvs/busybox/console-tools/loadacm.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- loadacm.c	19 Mar 2003 09:11:28 -0000	1.23
+++ loadacm.c	20 Dec 2003 06:00:08 -0000	1.24
@@ -37,10 +37,7 @@
 		bb_show_usage();
 	}
 
-	fd = open(CURRENT_VC, O_RDWR);
-	if (fd < 0) {
-		bb_perror_msg_and_die("Error opening " CURRENT_VC);
-	}
+	fd = bb_xopen(CURRENT_VC, O_RDWR);
 
 	if (screen_map_load(fd, stdin)) {
 		bb_perror_msg_and_die("Error loading acm");

Index: openvt.c
===================================================================
RCS file: /var/cvs/busybox/console-tools/openvt.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- openvt.c	13 May 2003 16:31:15 -0000	1.5
+++ openvt.c	20 Dec 2003 06:00:08 -0000	1.6
@@ -48,11 +48,8 @@
 	if (!isdigit(argv[1][0]))
 	        bb_show_usage();
 
-	vtno = (int) atol(argv[1]);
-
-	/* if (vtno <= 0 || vtno > 63) */
-	if (vtno <= 0 || vtno > 12)
-		bb_error_msg_and_die("Illegal vt number (%d)", vtno);	  
+	/* check for Illegal vt number */
+	vtno=bb_xgetlarg(argv[1], 10, 1, 12);
 
 	sprintf(vtname, VTNAME, vtno);
 
@@ -73,8 +70,7 @@
 		close(0);			/* so that new vt becomes stdin */
 
 		/* and grab new one */
-		if ((fd = open(vtname, O_RDWR)) == -1)
-			bb_perror_msg_and_die("could not open %s", vtname);	  
+		fd = bb_xopen(vtname, O_RDWR);
 
 		/* Reassign stdout and sterr */
 		close(1);




More information about the busybox-cvs mailing list