public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] mkswap: remove unnecessary usage output
@ 2014-03-08 17:01 Sami Kerola
  2014-03-08 17:01 ` [PATCH 2/5] tests: check swaplabel, and perform more swapon boundary tests Sami Kerola
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Sami Kerola @ 2014-03-08 17:01 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-03-13 16:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-08 17:01 [PATCH 1/5] mkswap: remove unnecessary usage output Sami Kerola
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox