From a0b42dc3696247de5c1da09b78be55908c7f9d86 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 17 Jan 2014 14:33:31 +0100 Subject: [PATCH] mkswap: fix compiler warning [-Wunused-variable] Signed-off-by: Karel Zak --- disk-utils/mkswap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.47.2