[PATCH] mdev: fix bug with minor number parsing
Frank Sorenson
frank at tuxrocks.com
Wed Jan 11 09:36:45 UTC 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
When mdev is reading the "major:minor" from the /sys/.../dev file,
the last character of the string is '\n', so we don't want it to
factor into the minor number.
- --- busybox-1.1.0/util-linux/mdev.c.orig 2006-01-11 02:18:04.000000000 -0700
+++ busybox-1.1.0/util-linux/mdev.c 2006-01-11 02:31:56.000000000 -0700
@@ -50,7 +50,7 @@
device_name = strrchr(path, '/') + 1;
type = strncmp(path+5, "block/" ,6) ? S_IFCHR : S_IFBLK;
major = minor = 0;
- - for (s = temp; *s; s++) {
+ for (s = temp; *s != '\n' ; s++) {
if (*s == ':') {
major = minor;
minor = 0;
Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
frank at tuxrocks.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iD8DBQFDxNGtaI0dwg4A47wRArexAKDe1pC585UaAZUmPx/u/ZUfVLAf7wCg8mWI
fYjSIEw9VYO/5CbWDAbRVVQ=
=e/Oi
-----END PGP SIGNATURE-----
More information about the busybox
mailing list