diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2006-03-17 14:43:07 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2006-03-17 14:43:07 +0000 |
commit | b678932bdb4b0fd73d046c7eb934809c2e3e605d (patch) | |
tree | 5466b01c4a9586066e4adb231293812efc59be2a /usr.bin/tip/aculib/biz22.c | |
parent | 6d052bb0ddd1b432e9e85fc458c8d131d179f76e (diff) |
big prototype cleanup:
o make more functions static
o add all the prototypes to tip.h
o consistently declare functions in the cmd table
testing and ok dhill@
Diffstat (limited to 'usr.bin/tip/aculib/biz22.c')
-rw-r--r-- | usr.bin/tip/aculib/biz22.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.bin/tip/aculib/biz22.c b/usr.bin/tip/aculib/biz22.c index 75a0d13f46b..702faf0e7b4 100644 --- a/usr.bin/tip/aculib/biz22.c +++ b/usr.bin/tip/aculib/biz22.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biz22.c,v 1.11 2003/06/03 02:56:18 millert Exp $ */ +/* $OpenBSD: biz22.c,v 1.12 2006/03/17 14:43:06 moritz Exp $ */ /* $NetBSD: biz22.c,v 1.6 1997/02/11 09:24:11 mrg Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)biz22.c 8.1 (Berkeley) 6/6/93"; #endif -static const char rcsid[] = "$OpenBSD: biz22.c,v 1.11 2003/06/03 02:56:18 millert Exp $"; +static const char rcsid[] = "$OpenBSD: biz22.c,v 1.12 2006/03/17 14:43:06 moritz Exp $"; #endif /* not lint */ #include "tip.h" @@ -42,7 +42,7 @@ static const char rcsid[] = "$OpenBSD: biz22.c,v 1.11 2003/06/03 02:56:18 miller #define DISCONNECT_CMD "\20\04" /* disconnection string */ static void sigALRM(); -static int timeout = 0; +static int dialtimeout = 0; static jmp_buf timeoutbuf; static int cmd(), detect(); @@ -91,7 +91,7 @@ biz_dialer(num, mod) */ connected = detect("1\r"); #ifdef ACULOG - if (timeout) { + if (dialtimeout) { char line[80]; (void)snprintf(line, sizeof line, "%ld second dial timeout", @@ -99,7 +99,7 @@ biz_dialer(num, mod) logent(value(HOST), num, "biz1022", line); } #endif - if (timeout) + if (dialtimeout) biz22_disconnect(); /* insurance */ return (connected); } @@ -138,8 +138,7 @@ biz22_abort() static void sigALRM() { - - timeout = 1; + dialtimeout = 1; longjmp(timeoutbuf, 1); } @@ -173,7 +172,7 @@ detect(s) char c; f = signal(SIGALRM, sigALRM); - timeout = 0; + dialtimeout = 0; while (*s) { if (setjmp(timeoutbuf)) { biz22_abort(); @@ -187,5 +186,5 @@ detect(s) return (0); } signal(SIGALRM, f); - return (timeout == 0); + return (dialtimeout == 0); } |