diff options
| author | mikel <mikel@NetBSD.org> | 1997-08-06 07:22:24 +0000 |
|---|---|---|
| committer | mikel <mikel@NetBSD.org> | 1997-08-06 07:22:24 +0000 |
| commit | 64521eb34398e46c31dee6fb76c8aa52fb134bdd (patch) | |
| tree | b066a8d862cf934f14dc9a7dc9834ceb6beef5b4 /libexec | |
| parent | a6da6f65852851918ced9bd9fda27474e5c2e34f (diff) | |
use <sys/cdefs.h> __COPYRIGHT() and __RCSID() macros
prototype internal functions and eliminate old function declarations
misc cleanup (gcc -Wall) and KNF
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/getty/init.c | 7 | ||||
| -rw-r--r-- | libexec/getty/main.c | 33 | ||||
| -rw-r--r-- | libexec/getty/subr.c | 18 |
3 files changed, 35 insertions, 23 deletions
diff --git a/libexec/getty/init.c b/libexec/getty/init.c index 4f98482faa1..b7fbe411c63 100644 --- a/libexec/getty/init.c +++ b/libexec/getty/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.7 1996/07/31 20:40:32 thorpej Exp $ */ +/* $NetBSD: init.c,v 1.8 1997/08/06 07:22:24 mikel Exp $ */ /* * Copyright (c) 1983, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "from: @(#)init.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$NetBSD: init.c,v 1.7 1996/07/31 20:40:32 thorpej Exp $"; +__RCSID("$NetBSD: init.c,v 1.8 1997/08/06 07:22:24 mikel Exp $"); #endif #endif /* not lint */ @@ -46,7 +47,9 @@ static char rcsid[] = "$NetBSD: init.c,v 1.7 1996/07/31 20:40:32 thorpej Exp $"; * * Melbourne getty. */ + #include <termios.h> + #include "gettytab.h" #include "pathnames.h" diff --git a/libexec/getty/main.c b/libexec/getty/main.c index b10038a621b..5a21d914834 100644 --- a/libexec/getty/main.c +++ b/libexec/getty/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.21 1997/08/06 05:40:28 mikel Exp $ */ +/* $NetBSD: main.c,v 1.22 1997/08/06 07:22:26 mikel Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -33,17 +33,18 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + #ifndef lint -static char copyright[] = -"@(#) Copyright (c) 1980, 1993\n\ - The Regents of the University of California. All rights reserved.\n"; +__COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "from: @(#)main.c 8.1 (Berkeley) 6/20/93"; #else -static char rcsid[] = "$NetBSD: main.c,v 1.21 1997/08/06 05:40:28 mikel Exp $"; +__RCSID("$NetBSD: main.c,v 1.22 1997/08/06 07:22:26 mikel Exp $"); #endif #endif /* not lint */ @@ -87,8 +88,6 @@ struct utsname kerninfo; char name[16]; char dev[] = _PATH_DEV; char ttyn[32]; -char *portselector(); -char *ttyname(); #define OBUFSIZ 128 #define TABBUFSIZ 512 @@ -121,10 +120,15 @@ char partab[] = { #define KILL tmode.c_cc[VKILL] #define EOT tmode.c_cc[VEOF] +static void dingdong __P((int)); +static void interrupt __P((int)); +void timeoverrun __P((int)); + jmp_buf timeout; static void -dingdong() +dingdong(signo) + int signo; { alarm(0); @@ -135,7 +139,8 @@ dingdong() jmp_buf intrupt; static void -interrupt() +interrupt(signo) + int signo; { signal(SIGINT, interrupt); @@ -154,6 +159,7 @@ timeoverrun(signo) exit(1); } +int main __P((int, char **)); static int getname __P((void)); static void oflush __P((void)); static void prompt __P((void)); @@ -169,10 +175,13 @@ main(argc, argv) { extern char **environ; char *tname; - long allflags; int repcnt = 0, failopenlogged = 0; struct rlimit limit; +#ifdef __GNUC__ + (void)&tname; /* XXX gcc -Wall */ +#endif + signal(SIGINT, SIG_IGN); /* signal(SIGQUIT, SIG_DFL); @@ -270,8 +279,6 @@ main(argc, argv) exit(1); } if (AB) { - extern char *autobaud(); - tname = autobaud(); continue; } @@ -415,7 +422,7 @@ getname() *np = 0; if (c == '\r') crmod = 1; - if (upper && !lower && !LC || UC) + if ((upper && !lower && !LC) || UC) for (np = name; *np; np++) if (isupper(*np)) *np = tolower(*np); diff --git a/libexec/getty/subr.c b/libexec/getty/subr.c index 13fba225ef5..2c9bc3aeb02 100644 --- a/libexec/getty/subr.c +++ b/libexec/getty/subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr.c,v 1.21 1997/04/29 21:01:55 tls Exp $ */ +/* $NetBSD: subr.c,v 1.22 1997/08/06 07:22:26 mikel Exp $ */ /* * Copyright (c) 1983, 1993 @@ -33,11 +33,12 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> #ifndef lint #if 0 static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93"; #else -static char rcsid[] = "$NetBSD: subr.c,v 1.21 1997/04/29 21:01:55 tls Exp $"; +__RCSID("$NetBSD: subr.c,v 1.22 1997/08/06 07:22:26 mikel Exp $"); #endif #endif /* not lint */ @@ -46,15 +47,16 @@ static char rcsid[] = "$NetBSD: subr.c,v 1.21 1997/04/29 21:01:55 tls Exp $"; */ #define COMPAT_43 #include <sys/param.h> +#include <sys/ioctl.h> + #include <stdlib.h> -#include <unistd.h> #include <string.h> #include <termios.h> -#include <sys/ioctl.h> +#include <unistd.h> +#include "extern.h" #include "gettytab.h" #include "pathnames.h" -#include "extern.h" extern struct termios tmode, omode; @@ -264,7 +266,7 @@ setflags(n) CLR(cflag, PARODD); if (AP) CLR(iflag, INPCK); - } else if (AP || EP && OP) { + } else if (AP || (EP && OP)) { CLR(iflag, INPCK|IGNPAR); CLR(cflag, PARODD); } @@ -614,9 +616,9 @@ makeenv(env) termbuf[127] = (char)NULL; *ep++ = termbuf; } - if (p = EV) { + if ((p = EV) != NULL) { q = p; - while (q = strchr(q, ',')) { + while ((q = strchr(q, ',')) != NULL) { *q++ = '\0'; *ep++ = p; p = q; |
