]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: add alignment check
authorDavidlohr Bueso <dave@gnu.org>
Sat, 9 Apr 2011 00:20:53 +0000 (21:20 -0300)
committerKarel Zak <kzak@redhat.com>
Tue, 12 Apr 2011 11:13:28 +0000 (13:13 +0200)
This patch produces the program to warn if the given device is misaligned.

[kzak@redhat.com: - call the check for block devices only]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/mkswap.c

index 599b9b047c06fd03d7a783d54039cebddac42158..a621641a0993d382f12d2bcd6af3b5e1f3d0cae2 100644 (file)
@@ -599,6 +599,8 @@ main(int argc, char **argv) {
                errx(EXIT_FAILURE, _("error: "
                        "%s is mounted; will not make swapspace."),
                        device_name);
+       else if (blkdev_is_misaligned(DEV))
+               warnx(_("warning: %s is misaligned"), device_name);
 
        if (check)
                check_blocks();