summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nghook
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2003-08-17 09:06:08 +0000
committercharnier <charnier@FreeBSD.org>2003-08-17 09:06:08 +0000
commit66ad561fff9f39adc4348dfa494931435623e611 (patch)
treef50111f104683eafc2b758a0652abaa8560b38a9 /usr.sbin/nghook
parentd2464b0086c5a0ecf127b5a3714d0adbcf7d8496 (diff)
downloadFreeBSD-src-66ad561fff9f39adc4348dfa494931435623e611.zip
FreeBSD-src-66ad561fff9f39adc4348dfa494931435623e611.tar.gz
add FBSDID, compare getopt() against -1, use fprintf() + exit() in usage()
instead of errx() to get the message starting with "usage:".
Diffstat (limited to 'usr.sbin/nghook')
-rw-r--r--usr.sbin/nghook/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/nghook/main.c b/usr.sbin/nghook/main.c
index ec9d724..678c297 100644
--- a/usr.sbin/nghook/main.c
+++ b/usr.sbin/nghook/main.c
@@ -1,4 +1,3 @@
-
/*
* main.c
*
@@ -34,10 +33,12 @@
* THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
- * $FreeBSD$
* $Whistle: main.c,v 1.9 1999/01/20 00:26:26 archie Exp $
*/
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -80,7 +81,7 @@ main(int ac, char *av[])
int ch;
/* Parse flags */
- while ((ch = getopt(ac, av, "adlnsS")) != EOF) {
+ while ((ch = getopt(ac, av, "adlnsS")) != -1) {
switch (ch) {
case 'a':
asciiFlag = 1;
@@ -243,6 +244,6 @@ WriteAscii(u_char *buf, int len)
static void
Usage(void)
{
- errx(EX_USAGE, "usage: nghook [-adlnsS] path [hookname]");
+ fprintf(stderr, "usage: nghook [-adlnsS] path [hookname]\n");
+ exit(EX_USAGE);
}
-
OpenPOWER on IntegriCloud