summaryrefslogtreecommitdiffstats
path: root/usr.bin/comm/comm.c
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-06-30 06:40:16 +0000
committercharnier <charnier@FreeBSD.org>1997-06-30 06:40:16 +0000
commit6f0d89b1c2877708009204b20b664c31a23c2020 (patch)
treebcd9170a4f88a87055784a8f93cd7166d7d013c1 /usr.bin/comm/comm.c
parent2f5131f6ac077b241cea46234d94c94b7f198884 (diff)
downloadFreeBSD-src-6f0d89b1c2877708009204b20b664c31a23c2020.zip
FreeBSD-src-6f0d89b1c2877708009204b20b664c31a23c2020.tar.gz
Use err(3). Add DIAGNOSTIC section name in man page.
Diffstat (limited to 'usr.bin/comm/comm.c')
-rw-r--r--usr.bin/comm/comm.c12
1 files changed, 5 insertions, 7 deletions
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 <fcntl.h>
-#include <limits.h>
+#include <err.h>
#include <errno.h>
+#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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);
}
OpenPOWER on IntegriCloud