mkswap: add alignment check

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>
This commit is contained in:
Davidlohr Bueso 2011-04-08 21:20:53 -03:00 committed by Karel Zak
parent ba32692970
commit 95fa64da98
1 changed files with 2 additions and 0 deletions

View 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();