aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mdev.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-08 16:18:15 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-08 16:18:15 +0000
commitd6766c71a95b35ef12b9adbec9d32b0ca91fba74 (patch)
tree6e64125dfdb4a87898e0edfe7a630f0069b1d165 /util-linux/mdev.c
parent9acfed2d14cb8b2310fd3bb56ceed589a9348912 (diff)
downloadbusybox-w32-d6766c71a95b35ef12b9adbec9d32b0ca91fba74.tar.gz
busybox-w32-d6766c71a95b35ef12b9adbec9d32b0ca91fba74.tar.bz2
busybox-w32-d6766c71a95b35ef12b9adbec9d32b0ca91fba74.zip
mdev: microscopic enhancement, should change nothing
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r--util-linux/mdev.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index cc729e72a..d1b2684bc 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -178,17 +178,15 @@ static void make_device(char *path, int delete)
178 if (ENABLE_FEATURE_MDEV_CONF) chown(device_name, uid, gid); 178 if (ENABLE_FEATURE_MDEV_CONF) chown(device_name, uid, gid);
179 } 179 }
180 if (command) { 180 if (command) {
181 int rc; 181 /* setenv will leak memory, so use putenv */
182 char *s; 182 char *s = xasprintf("MDEV=%s", device_name);
183
184 s = xasprintf("MDEV=%s", device_name);
185 putenv(s);
186 rc = system(command);
187 s[4] = 0;
188 putenv(s); 183 putenv(s);
184 if (system(command) == -1)
185 bb_perror_msg_and_die("cannot run %s", command);
186 s[4] = '\0';
187 unsetenv(s);
189 free(s); 188 free(s);
190 free(command); 189 free(command);
191 if (rc == -1) bb_perror_msg_and_die("cannot run %s", command);
192 } 190 }
193 if (delete) unlink(device_name); 191 if (delete) unlink(device_name);
194} 192}