Magellan Linux

Contents of /trunk/busybox/patches/busybox-1.10.2-mdev.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 591 - (show annotations) (download)
Fri May 16 15:11:14 2008 UTC (15 years, 11 months ago) by niro
File size: 856 byte(s)
-official fixes for 1.10.2

1 --- busybox-1.10.2/util-linux/mdev.c Thu May 8 17:22:48 2008
2 +++ busybox-1.10.2-mdev/util-linux/mdev.c Fri May 9 20:16:18 2008
3 @@ -72,8 +72,14 @@
4 /* Determine device name, type, major and minor */
5 device_name = bb_basename(path);
6 /* http://kernel.org/doc/pending/hotplug.txt says that only
7 - * "/sys/block/..." is for block devices. "sys/bus" etc is not! */
8 - type = (strncmp(&path[5], "block/", 6) == 0 ? S_IFBLK : S_IFCHR);
9 + * "/sys/block/..." is for block devices. "/sys/bus" etc is not!
10 + * Since kernel 2.6.25 block devices are also in /sys/class/block. */
11 + /* TODO: would it be acceptable to just use strstr(path, "/block/")? */
12 + if (strncmp(&path[5], "class/block/"+6, 6) != 0
13 + && strncmp(&path[5], "class/block/", 12) != 0)
14 + type = S_IFCHR;
15 + else
16 + type = S_IFBLK;
17
18 if (ENABLE_FEATURE_MDEV_CONF) {
19 FILE *fp;