summaryrefslogtreecommitdiff
path: root/util-linux/mdev.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-22 21:35:16 +0000
committerDenis Vlasenko2008-05-22 21:35:16 +0000
commita959a2abdd5bef3dadcf653665831a14f404240c (patch)
treea44260c7592e6c841a3d366257454b1bb27c072f /util-linux/mdev.c
parent4801441e9a30015c6e11b300eae49c91b5c9af7a (diff)
downloadbusybox-a959a2abdd5bef3dadcf653665831a14f404240c.zip
busybox-a959a2abdd5bef3dadcf653665831a14f404240c.tar.gz
mdev: suppress "may be used uninitialized" warning
Diffstat (limited to 'util-linux/mdev.c')
-rw-r--r--util-linux/mdev.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index d5faf43..a4d6dfd 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -46,7 +46,7 @@ static void make_device(char *path, int delete)
char *dev_maj_min = path + strlen(path);
char *command = NULL;
char *alias = NULL;
- int aliaslink;
+ char aliaslink = aliaslink; /* for compiler */
/* Force the configuration file settings exactly. */
umask(0);
@@ -174,7 +174,7 @@ static void make_device(char *path, int delete)
char *s, *p;
unsigned i, n;
- aliaslink = (*next == '>');
+ aliaslink = *next;
val = next;
next = next_field(val);
/* substitute %1..9 with off[1..9], if any */
@@ -200,7 +200,7 @@ static void make_device(char *path, int delete)
s++;
}
#else
- aliaslink = (*next == '>');
+ aliaslink = *next;
val = next;
next = next_field(val);
alias = xstrdup(val + 1);
@@ -271,8 +271,9 @@ static void make_device(char *path, int delete)
}
}
- /* recreate device_name as a symlink to moved device node */
- if (rename(device_name, alias) == 0 && aliaslink)
+ /* move the device, and optionally
+ * make a symlink to moved device node */
+ if (rename(device_name, alias) == 0 && aliaslink == '>')
symlink(alias, device_name);
free(alias);