aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/mesg/mesg.c
diff options
context:
space:
mode:
authorPhilippe Charnier <charnier@FreeBSD.org>1997-07-24 07:00:17 +0000
committerPhilippe Charnier <charnier@FreeBSD.org>1997-07-24 07:00:17 +0000
commit7501dcaa3693212f47f0c4dcb7d1ec663d376623 (patch)
treed40a026f10f65d1a7aabc647848a1d49751f38e2 /usr.bin/mesg/mesg.c
parent950622c98761cdb3407add7ecd88258410746f9c (diff)
downloadsrc-7501dcaa3693212f47f0c4dcb7d1ec663d376623.tar.gz
src-7501dcaa3693212f47f0c4dcb7d1ec663d376623.zip
Add usage().
Notes
Notes: svn path=/head/; revision=27645
Diffstat (limited to 'usr.bin/mesg/mesg.c')
-rw-r--r--usr.bin/mesg/mesg.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.bin/mesg/mesg.c b/usr.bin/mesg/mesg.c
index 96906c62c5e8..5faffa4a7ef2 100644
--- a/usr.bin/mesg/mesg.c
+++ b/usr.bin/mesg/mesg.c
@@ -37,25 +37,30 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1987, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)mesg.c 8.2 (Berkeley) 1/21/94";
+#endif
+static const char rcsid[] =
+ "$Id$";
#endif /* not lint */
#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
-#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+static void usage __P((void));
+
int
main(argc, argv)
int argc;
@@ -69,7 +74,7 @@ main(argc, argv)
switch (ch) {
case '?':
default:
- goto usage;
+ usage();
}
argc -= optind;
argv += optind;
@@ -99,6 +104,13 @@ main(argc, argv)
exit(1);
}
-usage: (void)fprintf(stderr, "usage: mesg [y | n]\n");
+ usage();
+ return(0);
+}
+
+static void
+usage()
+{
+ (void)fprintf(stderr, "usage: mesg [y | n]\n");
exit(2);
}