From 793a05f8405e12ff2aa19811e2dd3bfa55e33b91 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 8 Mar 2014 11:01:53 -0600 Subject: [PATCH] mkswap: remove unnecessary usage output The usage output changes too often making unnecessarily expected output in test unstable. Besides in this case the usage ouput does not even help user, because invalid swap target size error cannot be fixed by specificing an option. Signed-off-by: Sami Kerola --- disk-utils/mkswap.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index a2c6529bde..ae73f80a3a 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -545,18 +545,16 @@ main(int argc, char **argv) { sz = get_size(device_name); if (!PAGES) PAGES = sz; - else if (PAGES > sz && !force) { + else if (PAGES > sz && !force) errx(EXIT_FAILURE, _("error: " "size %llu KiB is larger than device size %llu KiB"), PAGES*(pagesize/1024), sz*(pagesize/1024)); - } - if (PAGES < MIN_GOODPAGES) { - warnx(_("error: swap area needs to be at least %ld KiB"), - (long)(MIN_GOODPAGES * pagesize/1024)); - usage(stderr); - } + if (PAGES < MIN_GOODPAGES) + errx(EXIT_FAILURE, + _("error: swap area needs to be at least %ld KiB"), + (long)(MIN_GOODPAGES * pagesize / 1024)); #ifdef __linux__ if (get_linux_version() >= KERNEL_VERSION(2,3,4)) -- 2.47.3