Avoid some identifier confusion
Some toolchains are confused by have a local variable with the same
name as a function. FIXIT!
BUG=None
TEST=compilashunz
Change-Id: Id7befbcfc9c2cbcd14f4a229cbc8687e1f7ad72c
Reviewed-on: https://gerrit.chromium.org/gerrit/66294
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Chris Masone <cmasone@chromium.org>
diff --git a/rootdev.c b/rootdev.c
index ee877c0..76c931c 100644
--- a/rootdev.c
+++ b/rootdev.c
@@ -58,8 +58,8 @@
static dev_t devt_from_file(const char *file) {
char candidate[10]; /* TODO(wad) system-provided constant? */
ssize_t bytes = 0;
- unsigned int major = 0;
- unsigned int minor = 0;
+ unsigned int major_num = 0;
+ unsigned int minor_num = 0;
dev_t dev = 0;
int fd = -1;
@@ -74,10 +74,10 @@
if (bytes < 3)
return 0;
candidate[bytes] = 0;
- if (sscanf(candidate, "%u:%u", &major, &minor) == 2) {
+ if (sscanf(candidate, "%u:%u", &major_num, &minor_num) == 2) {
/* candidate's size artificially limits the size of the converted
* %u to safely convert to a signed int. */
- dev = makedev(major, minor);
+ dev = makedev(major_num, minor_num);
}
return dev;
}
@@ -302,8 +302,8 @@
int rootdev_create_devices(const char *name, dev_t dev, bool symlink) {
int ret = 0;
- unsigned int major = major(dev);
- unsigned int minor = minor(dev);
+ unsigned int major_num = major(dev);
+ unsigned int minor_num = minor(dev);
int i;
const struct part_config *config;
const char *part_s = rootdev_get_partition(name, strlen(name));
@@ -327,7 +327,7 @@
}
for (i = 0; i < kPartitionEntries; ++i) {
- dev = makedev(major, minor + config[i].offset);
+ dev = makedev(major_num, minor_num + config[i].offset);
errno = 0;
if (mknod(config[i].name,
S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,