diff options
author | Philippe Charnier <charnier@FreeBSD.org> | 1997-08-18 07:27:59 +0000 |
---|---|---|
committer | Philippe Charnier <charnier@FreeBSD.org> | 1997-08-18 07:27:59 +0000 |
commit | 71346dd10453d60620ef32942ee14c84ffcc1e03 (patch) | |
tree | 5a802cdf6a0e7fa756c969f1f9294a4be734f050 /usr.bin/tset/tset.c | |
parent | 14aebc178de8a3b59e37b6cc02010be9cacd3dbf (diff) | |
download | src-71346dd10453d60620ef32942ee14c84ffcc1e03.tar.gz src-71346dd10453d60620ef32942ee14c84ffcc1e03.zip |
Use err(3) insteadof local redefinition. Sync usage string with man page.
Notes
Notes:
svn path=/head/; revision=28370
Diffstat (limited to 'usr.bin/tset/tset.c')
-rw-r--r-- | usr.bin/tset/tset.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c index b25398b2dd6b..a097dcac8eef 100644 --- a/usr.bin/tset/tset.c +++ b/usr.bin/tset/tset.c @@ -32,24 +32,28 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1991, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)tset.c 8.1 (Berkeley) 6/9/93"; +#endif +static const char rcdif[] = + "$Id$"; #endif /* not lint */ #include <sys/types.h> #include <sys/ioctl.h> -#include <termios.h> -#include <errno.h> -#include <unistd.h> -#include <stdlib.h> -#include <stdio.h> #include <ctype.h> +#include <err.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <unistd.h> +#include <termios.h> #include "extern.h" void obsolete __P((char *[])); @@ -74,15 +78,15 @@ main(argc, argv) struct winsize win; #endif int ch, noinit, noset, quiet, Sflag, sflag, showterm, usingupper; - char savech, *p, *t, *tcapbuf, *ttype; + char *p, *t, *tcapbuf, *ttype; if (tcgetattr(STDERR_FILENO, &mode) < 0) - err("standard error: %s", strerror(errno)); + err(1, "standard error"); oldmode = mode; Ospeed = cfgetospeed(&mode); - if (p = strrchr(*argv, '/')) + if ((p = strrchr(*argv, '/'))) ++p; else p = *argv; @@ -262,9 +266,9 @@ obsolete(argv) char *argv[]; { for (; *argv; ++argv) { - if (argv[0][0] != '-' || argv[1] && argv[1][0] != '-' || - argv[0][1] != 'e' && argv[0][1] != 'i' && - argv[0][1] != 'k' || argv[0][2] != '\0') + if (argv[0][0] != '-' || (argv[1] && argv[1][0] != '-') || + (argv[0][1] != 'e' && argv[0][1] != 'i' && argv[0][1] != 'k') || + argv[0][2] != '\0') continue; switch(argv[0][1]) { case 'e': @@ -283,7 +287,9 @@ obsolete(argv) void usage() { - (void)fprintf(stderr, -"usage: tset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]\n"); + (void)fprintf(stderr, "%s\n%s\n", +"usage: tset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]", +" reset [-IQrSs] [-] [-e ch] [-i ch] [-k ch] [-m mapping] [terminal]"); exit(1); } + |