svn commit: trunk/busybox/util-linux
vda at busybox.net
vda at busybox.net
Thu May 22 21:35:19 UTC 2008
Author: vda
Date: 2008-05-22 14:35:16 -0700 (Thu, 22 May 2008)
New Revision: 22055
Log:
mdev: suppress "may be used uninitialized" warning
Modified:
trunk/busybox/util-linux/mdev.c
Changeset:
Modified: trunk/busybox/util-linux/mdev.c
===================================================================
--- trunk/busybox/util-linux/mdev.c 2008-05-22 21:32:26 UTC (rev 22054)
+++ trunk/busybox/util-linux/mdev.c 2008-05-22 21:35:16 UTC (rev 22055)
@@ -46,7 +46,7 @@
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 @@
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 @@
s++;
}
#else
- aliaslink = (*next == '>');
+ aliaslink = *next;
val = next;
next = next_field(val);
alias = xstrdup(val + 1);
@@ -271,8 +271,9 @@
}
}
- /* 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);
More information about the busybox-cvs
mailing list