svn commit: trunk/busybox/coreutils

landley at busybox.net landley at busybox.net
Mon Mar 6 19:31:40 UTC 2006


Author: landley
Date: 2006-03-06 11:31:39 -0800 (Mon, 06 Mar 2006)
New Revision: 14456

Log:
Walt Wimer noticed that mknod couldn't handle major or minor > 255.  Now our
limit checking autodetects what the system supports (at compile time).


Modified:
   trunk/busybox/coreutils/mknod.c


Changeset:
Modified: trunk/busybox/coreutils/mknod.c
===================================================================
--- trunk/busybox/coreutils/mknod.c	2006-03-06 14:20:43 UTC (rev 14455)
+++ trunk/busybox/coreutils/mknod.c	2006-03-06 19:31:39 UTC (rev 14456)
@@ -47,8 +47,10 @@
 
 		dev = 0;
 		if ((*name != 'p') && ((argc -= 2) == 2)) {
-			dev = (bb_xgetularg10_bnd(argv[2], 0, 255) << 8)
-				+ bb_xgetularg10_bnd(argv[3], 0, 255);
+			/* Autodetect what the system supports; thexe macros should
+			 * optimize out to two constants. */
+			dev = makedev(bb_xgetularg10_bnd(argv[2], 0, major(UINT_MAX)),
+						  bb_xgetularg10_bnd(argv[3], 0, minor(UINT_MAX)));
 		}
 
 		if (argc == 2) {




More information about the busybox-cvs mailing list