diff options
author | Chris Masone <cmasone@chromium.org> | 2013-08-19 18:52:52 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-08-20 16:47:45 -0700 |
commit | 15141a9e18d299ca1f13f5dd414b78499b59407b (patch) | |
tree | 7944ea7cf7fc0cb49ffe1633c9ad4331fd76989d | |
parent | d4c5b8be615a84dae6ced41747246d7a038b7b88 (diff) | |
download | rootdev-15141a9e18d299ca1f13f5dd414b78499b59407b.tar.gz |
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>
-rw-r--r-- | rootdev.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -58,8 +58,8 @@ static const int kPartitionEntries = 3; 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 @@ static dev_t devt_from_file(const char *file) { 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 @@ void rootdev_get_device_slave(char *slave, size_t size, dev_t *dev, 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 @@ int rootdev_create_devices(const char *name, dev_t dev, bool symlink) { } 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, |