summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-05 01:10:03 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-05 01:10:03 +0000
commit49b78fc1a8f1591fa172399b3be1dba4b7f23554 (patch)
treef34271a9e766725cb6ce59c35cc98d91ddf137ac /util-linux
parenta3087ca7495e33b19b122869d17defeb9c933d19 (diff)
downloadbusybox-w32-1_10_3.tar.gz
busybox-w32-1_10_3.tar.bz2
busybox-w32-1_10_3.zip
Apply post-1.10.2 fixes, bump version to 1.10.31_10_3
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mdev.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index f0a885482..2341a5a67 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -72,8 +72,14 @@ static void make_device(char *path, int delete)
72 /* Determine device name, type, major and minor */ 72 /* Determine device name, type, major and minor */
73 device_name = bb_basename(path); 73 device_name = bb_basename(path);
74 /* http://kernel.org/doc/pending/hotplug.txt says that only 74 /* http://kernel.org/doc/pending/hotplug.txt says that only
75 * "/sys/block/..." is for block devices. "sys/bus" etc is not! */ 75 * "/sys/block/..." is for block devices. "/sys/bus" etc is not!
76 type = (strncmp(&path[5], "block/", 6) == 0 ? S_IFBLK : S_IFCHR); 76 * Since kernel 2.6.25 block devices are also in /sys/class/block. */
77 /* TODO: would it be acceptable to just use strstr(path, "/block/")? */
78 if (strncmp(&path[5], "class/block/"+6, 6) != 0
79 && strncmp(&path[5], "class/block/", 12) != 0)
80 type = S_IFCHR;
81 else
82 type = S_IFBLK;
77 83
78 if (ENABLE_FEATURE_MDEV_CONF) { 84 if (ENABLE_FEATURE_MDEV_CONF) {
79 FILE *fp; 85 FILE *fp;
@@ -172,8 +178,9 @@ static void make_device(char *path, int delete)
172 /* substitute %1..9 with off[1..9], if any */ 178 /* substitute %1..9 with off[1..9], if any */
173 n = 0; 179 n = 0;
174 s = val; 180 s = val;
175 while (*s && *s++ == '%') 181 while (*s)
176 n++; 182 if (*s++ == '%')
183 n++;
177 184
178 p = alias = xzalloc(strlen(val) + n * strlen(device_name)); 185 p = alias = xzalloc(strlen(val) + n * strlen(device_name));
179 s = val + 1; 186 s = val + 1;