Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2011 05:56:51 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223976 - head/sbin/hastctl
Message-ID:  <201107130556.p6D5upPG071672@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Wed Jul 13 05:56:51 2011
New Revision: 223976
URL: http://svn.freebsd.org/changeset/base/223976

Log:
  When exiting with error because of an invalid command line argument
  use errx(3), not err(3), and the exit code from sysexits(3).
  
  Approved by:	pjd (mentor)

Modified:
  head/sbin/hastctl/hastctl.c

Modified: head/sbin/hastctl/hastctl.c
==============================================================================
--- head/sbin/hastctl/hastctl.c	Wed Jul 13 05:42:04 2011	(r223975)
+++ head/sbin/hastctl/hastctl.c	Wed Jul 13 05:56:51 2011	(r223976)
@@ -403,15 +403,15 @@ main(int argc, char *argv[])
 			break;
 		case 'e':
 			if (expand_number(optarg, &extentsize) < 0)
-				err(1, "Invalid extentsize");
+				errx(EX_USAGE, "Invalid extentsize");
 			break;
 		case 'k':
 			if (expand_number(optarg, &keepdirty) < 0)
-				err(1, "Invalid keepdirty");
+				errx(EX_USAGE, "Invalid keepdirty");
 			break;
 		case 'm':
 			if (expand_number(optarg, &mediasize) < 0)
-				err(1, "Invalid mediasize");
+				errx(EX_USAGE, "Invalid mediasize");
 			break;
 		case 'h':
 		default:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107130556.p6D5upPG071672>