svn commit: trunk/busybox/miscutils

aldot at busybox.net aldot at busybox.net
Sun Jan 21 11:20:02 UTC 2007


Author: aldot
Date: 2007-01-21 03:20:01 -0800 (Sun, 21 Jan 2007)
New Revision: 17430

Log:
- use makedev to get device number, else it gives wrong major/minor numbers to devices files on systems which use big device numbers.
  Closes #919


Modified:
   trunk/busybox/miscutils/makedevs.c


Changeset:
Modified: trunk/busybox/miscutils/makedevs.c
===================================================================
--- trunk/busybox/miscutils/makedevs.c	2007-01-21 10:46:53 UTC (rev 17429)
+++ trunk/busybox/miscutils/makedevs.c	2007-01-21 11:20:01 UTC (rev 17430)
@@ -185,7 +185,7 @@
 				full_name_inc = xmalloc(strlen(full_name) + 4);
 				for (i = start; i < count; i++) {
 					sprintf(full_name_inc, "%s%d", full_name, i);
-					rdev = (major << 8) + minor + (i * increment - start);
+					rdev = makedev(major, minor + (i * increment - start));
 					if (mknod(full_name_inc, mode, rdev) == -1) {
 						bb_perror_msg("line %d: cannot create node %s", linenum, full_name_inc);
 						ret = EXIT_FAILURE;
@@ -201,7 +201,7 @@
 				}
 				free(full_name_inc);
 			} else {
-				rdev = (major << 8) + minor;
+				rdev = makedev(major, minor);
 				if (mknod(full_name, mode, rdev) == -1) {
 					bb_perror_msg("line %d: cannot create node %s", linenum, full_name);
 					ret = EXIT_FAILURE;




More information about the busybox-cvs mailing list