]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
swaplabel: wrong version number in check
authorSami Kerola <kerolasa@iki.fi>
Sun, 16 Feb 2014 23:54:19 +0000 (23:54 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 17 Feb 2014 13:04:40 +0000 (14:04 +0100)
$ swaplabel /dev/sda2
swaplabel: /dev/sda2: unsupported swap version '1'

The mkswap does not allow any other version, so swaplabel(8) must be
wrong.

Reference: https://github.com/karelzak/util-linux/blob/master/disk-utils/mkswap.c#L520
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/swaplabel.c

index a5ccb7ec389caaedbf7e2ce794fc7b05653aae3c..5d048aabbe07b3de6f49568aabaa95b4d18b1008 100644 (file)
@@ -70,7 +70,7 @@ static blkid_probe get_swap_prober(const char *devname)
                /* supported is SWAPSPACE2 only */
                if (blkid_probe_lookup_value(pr, "VERSION", &version, NULL) == 0
                    && version
-                   && strcmp(version, "2"))
+                   && strcmp(version, "1"))
                        warnx(_("%s: unsupported swap version '%s'"),
                                                devname, version);
                else