diff --git a/usr.bin/mesg/mesg.1 b/usr.bin/mesg/mesg.1 index 7e96c554723b..2dce0b1651f9 100644 --- a/usr.bin/mesg/mesg.1 +++ b/usr.bin/mesg/mesg.1 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)mesg.1 8.1 (Berkeley) 6/6/93 -.\" $Id: mesg.1,v 1.4 1997/02/22 19:56:08 peter Exp $ +.\" $Id: mesg.1,v 1.5 1997/03/29 20:01:59 mpp Exp $ .\" .Dd June 6, 1993 .Dt MESG 1 @@ -39,11 +39,11 @@ .Nm mesg .Nd display (do not display) messages from other users .Sh SYNOPSIS -.Nm mesg +.Nm .Op Cm n | Cm y .Sh DESCRIPTION The -.Nm mesg +.Nm utility is invoked by a users to control write access others have to the terminal device associated with the standard error output. @@ -62,11 +62,11 @@ Permits messages to be displayed. .El .Pp If no arguments are given, -.Nm mesg +.Nm displays the present message status to the standard error output. .Pp The -.Nm mesg +.Nm utility exits with one of the following values: .Bl -tag -width flag -compact -offset indent .Pp @@ -87,6 +87,6 @@ An error has occurred. .Xr write 1 .Sh HISTORY A -.Nm mesg +.Nm command appeared in .At v1 . 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 #include #include -#include #include #include #include #include +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); } diff --git a/usr.bin/mk_cmds/mk_cmds.c b/usr.bin/mk_cmds/mk_cmds.c index 1c3a3fb6c53f..d3a6dbbbe9c4 100644 --- a/usr.bin/mk_cmds/mk_cmds.c +++ b/usr.bin/mk_cmds/mk_cmds.c @@ -26,6 +26,13 @@ extern FILE *output_file; extern FILE *yyin, *yyout; extern int yylineno; +static void +usage(void) +{ + fprintf(stderr, "usage: mk_cmds cmdtbl.ct\n"); + exit(1); +} + int main(argc, argv) int argc; @@ -35,12 +42,8 @@ main(argc, argv) int result; char *path, *p; - if (argc != 2) { - fputs("Usage: ", stderr); - fputs(argv[0], stderr); - fputs(" cmdtbl.ct\n", stderr); - exit(1); - } + if (argc != 2) + usage(); path = malloc(strlen(argv[1])+4); /* extra space to add ".ct" */ strcpy(path, argv[1]);