libfdisk/src/context.c: In function 'fdisk_assign_device':
libfdisk/src/context.c:549:7: warning: declaration of 'rc' shadows a previous local [-Wshadow]
libfdisk/src/context.c:542:10: note: shadowed declaration is here
[kzak@redhat.com: - add rc to debug message]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
int fdisk_assign_device(struct fdisk_context *cxt,
const char *fname, int readonly)
{
- int fd, rc = 0;
+ int fd;
DBG(CXT, ul_debugobj(cxt, "assigning device %s", fname));
assert(cxt);
fname, readonly ? "READ-ONLY" : "READ-WRITE"));
return 0;
fail:
- rc = -errno;
- if (fd >= 0)
- close(fd);
- DBG(CXT, ul_debugobj(cxt, "failed to assign device"));
- return rc;
+ {
+ int rc = -errno;
+ if (fd >= 0)
+ close(fd);
+ DBG(CXT, ul_debugobj(cxt, "failed to assign device [rc=%d]", rc));
+ return rc;
+ }
}
/**