From 6f0d89b1c2877708009204b20b664c31a23c2020 Mon Sep 17 00:00:00 2001 From: charnier Date: Mon, 30 Jun 1997 06:40:16 +0000 Subject: Use err(3). Add DIAGNOSTIC section name in man page. --- usr.bin/comm/comm.1 | 5 +++-- usr.bin/comm/comm.c | 12 +++++------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/comm/comm.1 b/usr.bin/comm/comm.1 index 0897430..72ee36f 100644 --- a/usr.bin/comm/comm.1 +++ b/usr.bin/comm/comm.1 @@ -80,7 +80,7 @@ printed in column number three will have one. .Nm Comm assumes that the files are lexically sorted; all characters participate in line comparisons. -.Pp +.Sh DIAGNOSTICS .Nm Comm exits 0 on success, >0 if an error occurred. .Sh SEE ALSO @@ -91,4 +91,5 @@ exits 0 on success, >0 if an error occurred. .Sh STANDARDS The .Nm comm -command is expected to be POSIX 1003.2 compatible. +utility conforms to +.St -p1003.2-92 . diff --git a/usr.bin/comm/comm.c b/usr.bin/comm/comm.c index 1037c29..46707bb 100644 --- a/usr.bin/comm/comm.c +++ b/usr.bin/comm/comm.c @@ -44,9 +44,9 @@ static char copyright[] = static char sccsid[] = "@(#)comm.c 8.4 (Berkeley) 5/4/95"; #endif /* not lint */ -#include -#include +#include #include +#include #include #include #include @@ -58,7 +58,7 @@ char *tabs[] = { "", "\t", "\t\t" }; FILE *file __P((char *)); void show __P((FILE *, char *, char *)); -void usage __P((void)); +static void usage __P((void)); int main(argc, argv) @@ -172,16 +172,14 @@ file(name) if (!strcmp(name, "-")) return (stdin); if ((fp = fopen(name, "r")) == NULL) { - (void)fprintf(stderr, "comm: %s: %s\n", name, strerror(errno)); - exit(1); + err(1, "%s", name); } return (fp); } -void +static void usage() { - (void)fprintf(stderr, "usage: comm [-123] file1 file2\n"); exit(1); } -- cgit v1.1