diff options
author | Zhilong Liu <zlliu@suse.com> | 2017-04-01 14:51:44 +0200 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@gmail.com> | 2017-04-05 17:47:04 +0200 |
commit | 230a0dde0926125b8895e02a669b4701f79c0f07 (patch) | |
tree | 7117d38265eebfeda31fbaa7b73de823a0b535af /Create.c | |
parent | sysfs: Make sysfs_init() return an error code (diff) | |
download | mdadm-230a0dde0926125b8895e02a669b4701f79c0f07.tar.xz mdadm-230a0dde0926125b8895e02a669b4701f79c0f07.zip |
mdadm/Create: declaring an existing struct within same function
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@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@gmail.com>
Diffstat (limited to 'Create.c')
-rw-r--r-- | Create.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -868,7 +868,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) @@ -924,9 +924,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); @@ -947,8 +947,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: |