Lines 72-83
Link Here
|
72 |
/* http://kernel.org/doc/pending/hotplug.txt says that only |
72 |
/* http://kernel.org/doc/pending/hotplug.txt says that only |
73 |
* "/sys/block/..." is for block devices. "/sys/bus" etc is not! |
73 |
* "/sys/block/..." is for block devices. "/sys/bus" etc is not! |
74 |
* Since kernel 2.6.25 block devices are also in /sys/class/block. */ |
74 |
* Since kernel 2.6.25 block devices are also in /sys/class/block. */ |
75 |
/* TODO: would it be acceptable to just use strstr(path, "/block/")? */ |
75 |
if (strstr(path, "/block/") |
76 |
if (strncmp(&path[5], "class/block/"+6, 6) != 0 |
|
|
77 |
&& strncmp(&path[5], "class/block/", 12) != 0) |
78 |
type = S_IFCHR; |
79 |
else |
80 |
type = S_IFBLK; |
76 |
type = S_IFBLK; |
|
|
77 |
else |
78 |
type = S_IFCHR; |
81 |
|
79 |
|
82 |
if (ENABLE_FEATURE_MDEV_CONF) { |
80 |
if (ENABLE_FEATURE_MDEV_CONF) { |
83 |
FILE *fp; |
81 |
FILE *fp; |