]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: remove unnecessary usage output
authorSami Kerola <kerolasa@iki.fi>
Sat, 8 Mar 2014 17:01:53 +0000 (11:01 -0600)
committerKarel Zak <kzak@redhat.com>
Wed, 12 Mar 2014 11:06:33 +0000 (12:06 +0100)
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 <kerolasa@iki.fi>
disk-utils/mkswap.c

index a2c6529bdedcaacaeecdc65bda5c8dae47d1ba20..ae73f80a3acb9d234e23f011b5fd0aab10362d59 100644 (file)
@@ -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))