=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/telnet/sys_bsd.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/telnet/sys_bsd.c 1996/12/11 17:14:22 1.4 --- src/usr.bin/telnet/sys_bsd.c 1998/03/12 04:57:40 1.5 *************** *** 1,4 **** ! /* $OpenBSD: sys_bsd.c,v 1.4 1996/12/11 17:14:22 robin Exp $ */ /* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: sys_bsd.c,v 1.5 1998/03/12 04:57:40 art Exp $ */ /* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */ /* *************** *** 34,81 **** * SUCH DAMAGE. */ ! #ifndef lint ! #if 0 ! from: static char sccsid[] = "@(#)sys_bsd.c 8.4 (Berkeley) 5/30/95"; ! static char rcsid[] = "$NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $"; ! #else ! static char rcsid[] = "$OpenBSD: sys_bsd.c,v 1.4 1996/12/11 17:14:22 robin Exp $"; ! #endif ! #endif /* not lint */ /* * The following routines try to encapsulate what is system dependent * (at least between 4.x and dos) which is used in telnet.c. */ - - #include - #include - #include - #include - #include - #include - #include - #include - - #include "ring.h" - - #include "fdset.h" - - #include "defines.h" - #include "externs.h" - #include "types.h" - - #if defined(CRAY) || (defined(USE_TERMIO) && !defined(SYSV_TERMIO)) - #define SIG_FUNC_RET void - #else - #define SIG_FUNC_RET int - #endif - - #ifdef SIGINFO - extern SIG_FUNC_RET ayt_status(); - #endif - int tout, /* Output file descriptor */ tin, /* Input file descriptor */ --- 34,46 ---- * SUCH DAMAGE. */ ! #include "telnet_locl.h" /* * The following routines try to encapsulate what is system dependent * (at least between 4.x and dos) which is used in telnet.c. */ int tout, /* Output file descriptor */ tin, /* Input file descriptor */ *************** *** 91,98 **** # define old_tc ottyb #else /* USE_TERMIO */ ! struct termio old_tc = { 0 }; ! extern struct termio new_tc; # ifndef TCSANOW # ifdef TCSETS --- 56,63 ---- # define old_tc ottyb #else /* USE_TERMIO */ ! struct termios old_tc = { 0 }; ! extern struct termios new_tc; # ifndef TCSANOW # ifdef TCSETS *************** *** 391,396 **** --- 356,367 ---- * local/no signal mapping */ + #ifdef SIGTSTP + static void susp(); + #endif /* SIGTSTP */ + #ifdef SIGINFO + static void ayt(); + #endif void TerminalNewMode(f) *************** *** 403,409 **** struct sgttyb sb; int lmode; #else /* USE_TERMIO */ ! struct termio tmp_tc; #endif /* USE_TERMIO */ int onoff; int old; --- 374,380 ---- struct sgttyb sb; int lmode; #else /* USE_TERMIO */ ! struct termios tmp_tc; #endif /* USE_TERMIO */ int onoff; int old; *************** *** 603,612 **** tmp_tc.c_iflag &= ~ISTRIP; else tmp_tc.c_iflag |= ISTRIP; ! if (f & MODE_OUTBIN) { tmp_tc.c_cflag &= ~(CSIZE|PARENB); tmp_tc.c_cflag |= CS8; ! tmp_tc.c_oflag &= ~OPOST; } else { tmp_tc.c_cflag &= ~(CSIZE|PARENB); tmp_tc.c_cflag |= old_tc.c_cflag & (CSIZE|PARENB); --- 574,587 ---- tmp_tc.c_iflag &= ~ISTRIP; else tmp_tc.c_iflag |= ISTRIP; ! if ((f & MODE_OUTBIN) || (f & MODE_OUT8)) { tmp_tc.c_cflag &= ~(CSIZE|PARENB); tmp_tc.c_cflag |= CS8; ! if(f & MODE_OUTBIN) ! tmp_tc.c_oflag &= ~OPOST; ! else ! tmp_tc.c_oflag |= OPOST; ! } else { tmp_tc.c_cflag &= ~(CSIZE|PARENB); tmp_tc.c_cflag |= old_tc.c_cflag & (CSIZE|PARENB); *************** *** 618,630 **** if (f != -1) { #ifdef SIGTSTP - SIG_FUNC_RET susp(); - #endif /* SIGTSTP */ - #ifdef SIGINFO - SIG_FUNC_RET ayt(); - #endif - - #ifdef SIGTSTP (void) signal(SIGTSTP, susp); #endif /* SIGTSTP */ #ifdef SIGINFO --- 593,598 ---- *************** *** 670,678 **** #endif } else { #ifdef SIGINFO ! SIG_FUNC_RET ayt_status(); ! (void) signal(SIGINFO, ayt_status); #endif #ifdef SIGTSTP (void) signal(SIGTSTP, SIG_DFL); --- 638,646 ---- #endif } else { #ifdef SIGINFO ! void ayt_status(); ! (void) signal(SIGINFO, (void (*)(int))ayt_status); #endif #ifdef SIGTSTP (void) signal(SIGTSTP, SIG_DFL); *************** *** 868,874 **** */ /* ARGSUSED */ ! SIG_FUNC_RET deadpeer(sig) int sig; { --- 836,842 ---- */ /* ARGSUSED */ ! void deadpeer(sig) int sig; { *************** *** 877,883 **** } /* ARGSUSED */ ! SIG_FUNC_RET intr(sig) int sig; { --- 845,851 ---- } /* ARGSUSED */ ! void intr(sig) int sig; { *************** *** 890,896 **** } /* ARGSUSED */ ! SIG_FUNC_RET intr2(sig) int sig; { --- 858,864 ---- } /* ARGSUSED */ ! void intr2(sig) int sig; { *************** *** 907,913 **** #ifdef SIGTSTP /* ARGSUSED */ ! SIG_FUNC_RET susp(sig) int sig; { --- 875,881 ---- #ifdef SIGTSTP /* ARGSUSED */ ! void susp(sig) int sig; { *************** *** 920,926 **** #ifdef SIGWINCH /* ARGSUSED */ ! SIG_FUNC_RET sendwin(sig) int sig; { --- 888,894 ---- #ifdef SIGWINCH /* ARGSUSED */ ! void sendwin(sig) int sig; { *************** *** 932,938 **** #ifdef SIGINFO /* ARGSUSED */ ! SIG_FUNC_RET ayt(sig) int sig; { --- 900,906 ---- #ifdef SIGINFO /* ARGSUSED */ ! void ayt(sig) int sig; { *************** *** 1197,1215 **** if (c < 0 && errno == EWOULDBLOCK) { c = 0; } else { ! if (c < 0) { ! return -1; ! } ! if (c == 0) { /* must be an EOF... */ ! if (MODE_LOCAL_CHARS(globalmode) && isatty(tin)) { ! *ttyiring.supply = termEofChar; ! c = 1; ! } else { ! clienteof = 1; ! shutdown(net, 1); ! return 0; ! } } if (termdata) { Dump('<', ttyiring.supply, c); --- 1165,1178 ---- if (c < 0 && errno == EWOULDBLOCK) { c = 0; } else { ! /* EOF detection for line mode!!!! */ ! if ((c == 0) && MODE_LOCAL_CHARS(globalmode) && isatty(tin)) { /* must be an EOF... */ ! *ttyiring.supply = termEofChar; ! c = 1; ! } ! if (c <= 0) { ! return -1; } if (termdata) { Dump('<', ttyiring.supply, c);