=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/lock/lock.c,v retrieving revision 1.8 retrieving revision 1.9 diff -c -r1.8 -r1.9 *** src/usr.bin/lock/lock.c 1997/01/15 23:42:45 1.8 --- src/usr.bin/lock/lock.c 1997/07/27 21:29:59 1.9 *************** *** 1,4 **** ! /* $OpenBSD: lock.c,v 1.8 1997/01/15 23:42:45 millert Exp $ */ /* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: lock.c,v 1.9 1997/07/27 21:29:59 millert Exp $ */ /* $NetBSD: lock.c,v 1.8 1996/05/07 18:32:31 jtc Exp $ */ /* *************** *** 47,53 **** #if 0 static char sccsid[] = "@(#)lock.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: lock.c,v 1.8 1997/01/15 23:42:45 millert Exp $"; #endif /* not lint */ /* --- 47,53 ---- #if 0 static char sccsid[] = "@(#)lock.c 8.1 (Berkeley) 6/6/93"; #endif ! static char rcsid[] = "$OpenBSD: lock.c,v 1.9 1997/07/27 21:29:59 millert Exp $"; #endif /* not lint */ /* *************** *** 78,92 **** #define TIMEOUT 15 ! void quit(), bye(), hi(); struct timeval timeout; struct timeval zerotime; struct termios tty, ntty; long nexttime; /* keep the timeout time */ ! int no_timeout; /* lock terminal forever */ /*ARGSUSED*/ main(argc, argv) int argc; char **argv; --- 78,96 ---- #define TIMEOUT 15 ! int skey_auth __P((char *)); ! void quit __P((int)); ! void bye __P((int)); ! void hi __P((int)); struct timeval timeout; struct timeval zerotime; struct termios tty, ntty; long nexttime; /* keep the timeout time */ ! int no_timeout; /* lock terminal forever */ /*ARGSUSED*/ + int main(argc, argv) int argc; char **argv; *************** *** 152,158 **** /* get key and check again */ printf("Key: "); if (!fgets(s, sizeof(s), stdin) || *s == '\n') ! quit(); printf("\nAgain: "); /* * Don't need EOF test here, if we get EOF, then s1 != s --- 156,162 ---- /* get key and check again */ printf("Key: "); if (!fgets(s, sizeof(s), stdin) || *s == '\n') ! quit(0); printf("\nAgain: "); /* * Don't need EOF test here, if we get EOF, then s1 != s *************** *** 193,199 **** printf("Key: "); if (!fgets(s, sizeof(s), stdin)) { clearerr(stdin); ! hi(); continue; } if (usemine) { --- 197,203 ---- printf("Key: "); if (!fgets(s, sizeof(s), stdin)) { clearerr(stdin); ! hi(0); continue; } if (usemine) { *************** *** 217,223 **** if (tcsetattr(0, TCSADRAIN, &ntty) < 0) exit(1); } ! quit(); } #ifdef SKEY --- 221,229 ---- if (tcsetattr(0, TCSADRAIN, &ntty) < 0) exit(1); } ! ! quit(0); ! exit(0); /*NOTREACHED*/ } #ifdef SKEY *************** *** 249,255 **** #endif void ! hi() { struct timeval timval; --- 255,262 ---- #endif void ! hi(dummy) ! int dummy; { struct timeval timval; *************** *** 266,272 **** } void ! quit() { putchar('\n'); (void)tcsetattr(0, TCSADRAIN, &tty); --- 273,280 ---- } void ! quit(dummy) ! int dummy; { putchar('\n'); (void)tcsetattr(0, TCSADRAIN, &tty); *************** *** 274,280 **** } void ! bye() { if (!no_timeout) { (void)tcsetattr(0, TCSADRAIN, &tty); --- 282,289 ---- } void ! bye(dummy) ! int dummy; { if (!no_timeout) { (void)tcsetattr(0, TCSADRAIN, &tty);