← Commit list

aa8a60108

Denis Vlasenko
Denis Vlasenko
2008-03-29
FAILED Duration: 18s

Subject

mdev: fix block/char device detection. Closes bug 2144.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/mdev.c+3 -1
@@ -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;