From: Sami Kerola Date: Sat, 8 Mar 2014 17:01:53 +0000 (-0600) Subject: mkswap: remove unnecessary usage output X-Git-Tag: v2.25-rc1~434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=793a05f8405e12ff2aa19811e2dd3bfa55e33b91;p=thirdparty%2Futil-linux.git 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 --- 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))