diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-22 21:35:16 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-22 21:35:16 +0000 |
commit | a959a2abdd5bef3dadcf653665831a14f404240c (patch) | |
tree | a44260c7592e6c841a3d366257454b1bb27c072f /util-linux/mdev.c | |
parent | 4801441e9a30015c6e11b300eae49c91b5c9af7a (diff) | |
download | busybox-w32-a959a2abdd5bef3dadcf653665831a14f404240c.tar.gz busybox-w32-a959a2abdd5bef3dadcf653665831a14f404240c.tar.bz2 busybox-w32-a959a2abdd5bef3dadcf653665831a14f404240c.zip |
mdev: suppress "may be used uninitialized" warning
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r-- | util-linux/mdev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index d5faf432e..a4d6dfdf9 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c | |||
@@ -46,7 +46,7 @@ static void make_device(char *path, int delete) | |||
46 | char *dev_maj_min = path + strlen(path); | 46 | char *dev_maj_min = path + strlen(path); |
47 | char *command = NULL; | 47 | char *command = NULL; |
48 | char *alias = NULL; | 48 | char *alias = NULL; |
49 | int aliaslink; | 49 | char aliaslink = aliaslink; /* for compiler */ |
50 | 50 | ||
51 | /* Force the configuration file settings exactly. */ | 51 | /* Force the configuration file settings exactly. */ |
52 | umask(0); | 52 | umask(0); |
@@ -174,7 +174,7 @@ static void make_device(char *path, int delete) | |||
174 | char *s, *p; | 174 | char *s, *p; |
175 | unsigned i, n; | 175 | unsigned i, n; |
176 | 176 | ||
177 | aliaslink = (*next == '>'); | 177 | aliaslink = *next; |
178 | val = next; | 178 | val = next; |
179 | next = next_field(val); | 179 | next = next_field(val); |
180 | /* substitute %1..9 with off[1..9], if any */ | 180 | /* substitute %1..9 with off[1..9], if any */ |
@@ -200,7 +200,7 @@ static void make_device(char *path, int delete) | |||
200 | s++; | 200 | s++; |
201 | } | 201 | } |
202 | #else | 202 | #else |
203 | aliaslink = (*next == '>'); | 203 | aliaslink = *next; |
204 | val = next; | 204 | val = next; |
205 | next = next_field(val); | 205 | next = next_field(val); |
206 | alias = xstrdup(val + 1); | 206 | alias = xstrdup(val + 1); |
@@ -271,8 +271,9 @@ static void make_device(char *path, int delete) | |||
271 | } | 271 | } |
272 | } | 272 | } |
273 | 273 | ||
274 | /* recreate device_name as a symlink to moved device node */ | 274 | /* move the device, and optionally |
275 | if (rename(device_name, alias) == 0 && aliaslink) | 275 | * make a symlink to moved device node */ |
276 | if (rename(device_name, alias) == 0 && aliaslink == '>') | ||
276 | symlink(alias, device_name); | 277 | symlink(alias, device_name); |
277 | 278 | ||
278 | free(alias); | 279 | free(alias); |