=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/tty.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/mail/tty.c 1996/06/11 12:53:52 1.2 --- src/usr.bin/mail/tty.c 1997/07/13 21:21:17 1.3 *************** *** 1,5 **** ! /* $OpenBSD: tty.c,v 1.2 1996/06/11 12:53:52 deraadt Exp $ */ ! /* $NetBSD: tty.c,v 1.5 1996/06/08 19:48:43 christos Exp $ */ /* * Copyright (c) 1980, 1993 --- 1,5 ---- ! /* $OpenBSD: tty.c,v 1.3 1997/07/13 21:21:17 millert Exp $ */ ! /* $NetBSD: tty.c,v 1.7 1997/07/09 05:25:46 mikel Exp $ */ /* * Copyright (c) 1980, 1993 *************** *** 36,44 **** #ifndef lint #if 0 ! static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: tty.c,v 1.2 1996/06/11 12:53:52 deraadt Exp $"; #endif #endif /* not lint */ --- 36,44 ---- #ifndef lint #if 0 ! static char sccsid[] = "@(#)tty.c 8.2 (Berkeley) 4/20/95"; #else ! static char rcsid[] = "$OpenBSD: tty.c,v 1.3 1997/07/13 21:21:17 millert Exp $"; #endif #endif /* not lint */ *************** *** 73,78 **** --- 73,80 ---- sig_t saveint; #ifndef TIOCSTI sig_t savequit; + #else + int extproc, flag; #endif sig_t savetstp; sig_t savettou; *************** *** 80,85 **** --- 82,90 ---- int errs; #ifdef __GNUC__ /* Avoid longjmp clobbering */ + #ifdef TIOCSTI + (void) &extproc; + #endif (void) &saveint; #endif *************** *** 91,97 **** ttyset = 0; #endif if (tcgetattr(fileno(stdin), &ttybuf) < 0) { ! perror("tcgetattr"); return(-1); } c_erase = ttybuf.c_cc[VERASE]; --- 96,102 ---- ttyset = 0; #endif if (tcgetattr(fileno(stdin), &ttybuf) < 0) { ! warn("tcgetattr"); return(-1); } c_erase = ttybuf.c_cc[VERASE]; *************** *** 104,109 **** --- 109,122 ---- if ((savequit = signal(SIGQUIT, SIG_IGN)) == SIG_DFL) signal(SIGQUIT, SIG_DFL); #else + # ifdef TIOCEXT + extproc = ((ttybuf.c_lflag & EXTPROC) ? 1 : 0); + if (extproc) { + flag = 0; + if (ioctl(fileno(stdin), TIOCEXT, &flag) < 0) + warn("TIOCEXT: off"); + } + # endif /* TIOCEXT */ if (setjmp(intjmp)) goto out; saveint = signal(SIGINT, ttyint); *************** *** 149,154 **** --- 162,175 ---- if (ttyset) tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); signal(SIGQUIT, savequit); + #else + # ifdef TIOCEXT + if (extproc) { + flag = 1; + if (ioctl(fileno(stdin), TIOCEXT, &flag) < 0) + warn("TIOCEXT: on"); + } + # endif /* TIOCEXT */ #endif signal(SIGINT, saveint); return(errs); *************** *** 177,183 **** fputs(pr, stdout); fflush(stdout); if (src != NOSTR && strlen(src) > BUFSIZ - 2) { ! printf("too long to edit\n"); return(src); } #ifndef TIOCSTI --- 198,204 ---- fputs(pr, stdout); fflush(stdout); if (src != NOSTR && strlen(src) > BUFSIZ - 2) { ! puts("too long to edit"); return(src); } #ifndef TIOCSTI