summaryrefslogtreecommitdiffstats
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
parent2f5131f6ac077b241cea46234d94c94b7f198884 (diff)
downloadFreeBSD-src-6f0d89b1c2877708009204b20b664c31a23c2020.zip
FreeBSD-src-6f0d89b1c2877708009204b20b664c31a23c2020.tar.gz
Use err(3). Add DIAGNOSTIC section name in man page.
-rw-r--r--usr.bin/comm/comm.15
-rw-r--r--usr.bin/comm/comm.c12
2 files changed, 8 insertions, 9 deletions
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 <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