diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-29 16:07:46 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-29 16:07:46 +0000 |
commit | aa8a601084f7f0fc74fc561e12b42f8d7e3a6fe9 (patch) | |
tree | 49986b140b1766e52c1a22c4d4ae226b619a7f6f /util-linux/mdev.c | |
parent | 02f12f53e8d7fa92dbf4e7c9c5cb011e7922d74c (diff) | |
download | busybox-w32-aa8a601084f7f0fc74fc561e12b42f8d7e3a6fe9.tar.gz busybox-w32-aa8a601084f7f0fc74fc561e12b42f8d7e3a6fe9.tar.bz2 busybox-w32-aa8a601084f7f0fc74fc561e12b42f8d7e3a6fe9.zip |
mdev: fix block/char device detection. Closes bug 2144.
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r-- | util-linux/mdev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index c4c4350a4..c8d603bcf 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
@@ -69,7 +69,9 @@ static void make_device(char *path, int delete) | |||
69 | 69 | ||
70 | /* Determine device name, type, major and minor */ | 70 | /* Determine device name, type, major and minor */ |
71 | device_name = bb_basename(path); | 71 | device_name = bb_basename(path); |
72 | type = (path[5] == 'c' ? S_IFCHR : S_IFBLK); /* "/sys/[c]lass"? */ | 72 | /* http://kernel.org/doc/pending/hotplug.txt says that only |
73 | * "/sys/block/..." is for block devices. "sys/bus" etc is not! */ | ||
74 | type = (strncmp(&path[5], "block/", 6) == 0 ? S_IFBLK : S_IFCHR); | ||
73 | 75 | ||
74 | if (ENABLE_FEATURE_MDEV_CONF) { | 76 | if (ENABLE_FEATURE_MDEV_CONF) { |
75 | FILE *fp; | 77 | FILE *fp; |