From: Karel Zak Date: Fri, 17 Jan 2014 13:33:31 +0000 (+0100) Subject: mkswap: fix compiler warning [-Wunused-variable] X-Git-Tag: v2.25-rc1~631 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a0b42dc3696247de5c1da09b78be55908c7f9d86;p=thirdparty%2Futil-linux.git mkswap: fix compiler warning [-Wunused-variable] Signed-off-by: Karel Zak --- diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index 71503f4462..a2c6529bde 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -399,7 +399,6 @@ wipe_device(int fd, const char *devname, int force) * Wipe boodbits */ char buf[1024]; - const char *data = NULL; if (lseek(fd, 0, SEEK_SET) != 0) errx(EXIT_FAILURE, _("unable to rewind swap-device")); @@ -419,6 +418,8 @@ wipe_device(int fd, const char *devname, int force) blkid_probe_set_superblocks_flags(pr, BLKID_SUBLKS_MAGIC|BLKID_SUBLKS_TYPE); while (blkid_do_probe(pr) == 0) { + const char *data = NULL; + if (blkid_probe_lookup_value(pr, "TYPE", &data, NULL) == 0 && data) warnx(_("%s: warning: wiping old %s signature."), devname, data); blkid_do_wipe(pr, 0);