Create:declaring 'struct stat stb' twice within the same function, rename stb as stb2 when declares 'struct stat' at the second time. Signed-off-by: Zhilong Liu <zlliu@xxxxxxxx> --- Create.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Create.c b/Create.c index e43c1d6..619e68a 100644 --- a/Create.c +++ b/Create.c @@ -865,7 +865,7 @@ int Create(struct supertype *st, char *mddev, for (dnum=0, raid_disk_num=0, dv = devlist ; dv ; dv=(dv->next)?(dv->next):moved_disk, dnum++) { int fd; - struct stat stb; + struct stat stb2; struct mdinfo *inf = &infos[dnum]; if (dnum >= total_slots) @@ -921,9 +921,9 @@ int Create(struct supertype *st, char *mddev, dv->devname); goto abort_locked; } - fstat(fd, &stb); - inf->disk.major = major(stb.st_rdev); - inf->disk.minor = minor(stb.st_rdev); + fstat(fd, &stb2); + inf->disk.major = major(stb2.st_rdev); + inf->disk.minor = minor(stb2.st_rdev); } if (fd >= 0) remove_partitions(fd); @@ -944,8 +944,8 @@ int Create(struct supertype *st, char *mddev, if (!have_container) { /* getinfo_super might have lost these ... */ - inf->disk.major = major(stb.st_rdev); - inf->disk.minor = minor(stb.st_rdev); + inf->disk.major = major(stb2.st_rdev); + inf->disk.minor = minor(stb2.st_rdev); } break; case 2: -- 2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html