diff options
author | Philippe Charnier <charnier@FreeBSD.org> | 2003-08-17 09:06:08 +0000 |
---|---|---|
committer | Philippe Charnier <charnier@FreeBSD.org> | 2003-08-17 09:06:08 +0000 |
commit | 96d282ece610550c78bf9426bc5d9404465445d5 (patch) | |
tree | f50111f104683eafc2b758a0652abaa8560b38a9 /usr.sbin/nghook/main.c | |
parent | 9a4e73fe5ea6f6fe518de8cb3d23cf6e397c8896 (diff) | |
download | src-96d282ece610550c78bf9426bc5d9404465445d5.tar.gz src-96d282ece610550c78bf9426bc5d9404465445d5.zip |
add FBSDID, compare getopt() against -1, use fprintf() + exit() in usage()
instead of errx() to get the message starting with "usage:".
Notes
Notes:
svn path=/head/; revision=119020
Diffstat (limited to 'usr.sbin/nghook/main.c')
-rw-r--r-- | usr.sbin/nghook/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/nghook/main.c b/usr.sbin/nghook/main.c index ec9d724aa813..678c297fd663 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); } - |