public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 1/5] mkswap: remove unnecessary usage output
Date: Sat,  8 Mar 2014 11:01:53 -0600	[thread overview]
Message-ID: <1394298117-16531-1-git-send-email-kerolasa@iki.fi> (raw)

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 | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index a2c6529..ae73f80 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))
-- 
1.9.0


             reply	other threads:[~2014-03-08 17:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-08 17:01 Sami Kerola [this message]
2014-03-08 17:01 ` [PATCH 2/5] tests: check swaplabel, and perform more swapon boundary tests Sami Kerola
2014-03-08 17:01 ` [PATCH 3/5] build-sys: sort gitignore files Sami Kerola
2014-03-08 17:01 ` [PATCH 4/5] docs: add a new command boilerplate code Sami Kerola
2014-03-08 17:01 ` [PATCH 5/5] build-sys: unify function and variable attribute spacing Sami Kerola
2014-03-12 11:07 ` [PATCH 1/5] mkswap: remove unnecessary usage output Karel Zak
2014-03-12 11:10   ` Karel Zak
2014-03-13 16:38     ` Sami Kerola

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394298117-16531-1-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox