]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: fix compiler warning [-Wunused-variable]
authorKarel Zak <kzak@redhat.com>
Fri, 17 Jan 2014 13:33:31 +0000 (14:33 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 17 Jan 2014 14:01:49 +0000 (15:01 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c

index 71503f4462a025387798393bc0d40f311a23d38c..a2c6529bdedcaacaeecdc65bda5c8dae47d1ba20 100644 (file)
@@ -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);