projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02f12f5
)
mdev: fix block/char device detection. Closes bug 2144.
author
Denis Vlasenko
<vda.linux@googlemail.com>
Sat, 29 Mar 2008 16:07:46 +0000
(16:07 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Sat, 29 Mar 2008 16:07:46 +0000
(16:07 -0000)
util-linux/mdev.c
patch
|
blob
|
history
diff --git
a/util-linux/mdev.c
b/util-linux/mdev.c
index c4c4350a4c9be7c5dcd5198d6358904a3accceb4..c8d603bcfcc9875bab68d3a4f5beca7c5d479bfc 100644
(file)
--- a/
util-linux/mdev.c
+++ b/
util-linux/mdev.c
@@
-69,7
+69,9
@@
static void make_device(char *path, int delete)
/* Determine device name, type, major and minor */
device_name = bb_basename(path);
- type = (path[5] == 'c' ? S_IFCHR : S_IFBLK); /* "/sys/[c]lass"? */
+ /* http://kernel.org/doc/pending/hotplug.txt says that only
+ * "/sys/block/..." is for block devices. "sys/bus" etc is not! */
+ type = (strncmp(&path[5], "block/", 6) == 0 ? S_IFBLK : S_IFCHR);
if (ENABLE_FEATURE_MDEV_CONF) {
FILE *fp;