version 1.7, 1997/07/22 18:54:45 |
version 1.8, 1997/07/30 06:32:41 |
|
|
ttybuf.c_cc[VERASE] = 0; |
ttybuf.c_cc[VERASE] = 0; |
ttybuf.c_cc[VKILL] = 0; |
ttybuf.c_cc[VKILL] = 0; |
if ((saveint = signal(SIGINT, SIG_IGN)) == SIG_DFL) |
if ((saveint = signal(SIGINT, SIG_IGN)) == SIG_DFL) |
signal(SIGINT, SIG_DFL); |
(void)signal(SIGINT, SIG_DFL); |
if ((savequit = signal(SIGQUIT, SIG_IGN)) == SIG_DFL) |
if ((savequit = signal(SIGQUIT, SIG_IGN)) == SIG_DFL) |
signal(SIGQUIT, SIG_DFL); |
(void)signal(SIGQUIT, SIG_DFL); |
#else |
#else |
# ifdef TIOCEXT |
# ifdef TIOCEXT |
extproc = ((ttybuf.c_lflag & EXTPROC) ? 1 : 0); |
extproc = ((ttybuf.c_lflag & EXTPROC) ? 1 : 0); |
|
|
extract(readtty("Bcc: ", detract(hp->h_bcc, 0)), GBCC); |
extract(readtty("Bcc: ", detract(hp->h_bcc, 0)), GBCC); |
} |
} |
out: |
out: |
signal(SIGTSTP, savetstp); |
(void)signal(SIGTSTP, savetstp); |
signal(SIGTTOU, savettou); |
(void)signal(SIGTTOU, savettou); |
signal(SIGTTIN, savettin); |
(void)signal(SIGTTIN, savettin); |
#ifndef TIOCSTI |
#ifndef TIOCSTI |
ttybuf.c_cc[VERASE] = c_erase; |
ttybuf.c_cc[VERASE] = c_erase; |
ttybuf.c_cc[VKILL] = c_kill; |
ttybuf.c_cc[VKILL] = c_kill; |
if (ttyset) |
if (ttyset) |
tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
tcsetattr(fileno(stdin), TCSADRAIN, &ttybuf); |
signal(SIGQUIT, savequit); |
(void)signal(SIGQUIT, savequit); |
#else |
#else |
# ifdef TIOCEXT |
# ifdef TIOCEXT |
if (extproc) { |
if (extproc) { |
|
|
} |
} |
# endif /* TIOCEXT */ |
# endif /* TIOCEXT */ |
#endif |
#endif |
signal(SIGINT, saveint); |
(void)signal(SIGINT, saveint); |
return(errs); |
return(errs); |
} |
} |
|
|
|
|
cp2 = cp; |
cp2 = cp; |
if (sigsetjmp(rewrite, 1)) |
if (sigsetjmp(rewrite, 1)) |
goto redo; |
goto redo; |
signal(SIGTSTP, ttystop); |
(void)signal(SIGTSTP, ttystop); |
signal(SIGTTOU, ttystop); |
(void)signal(SIGTTOU, ttystop); |
signal(SIGTTIN, ttystop); |
(void)signal(SIGTTIN, ttystop); |
clearerr(stdin); |
clearerr(stdin); |
while (cp2 < canonb + BUFSIZ) { |
while (cp2 < canonb + BUFSIZ) { |
c = getc(stdin); |
c = getc(stdin); |
|
|
*cp2++ = c; |
*cp2++ = c; |
} |
} |
*cp2 = 0; |
*cp2 = 0; |
signal(SIGTSTP, SIG_DFL); |
(void)signal(SIGTSTP, SIG_DFL); |
signal(SIGTTOU, SIG_DFL); |
(void)signal(SIGTTOU, SIG_DFL); |
signal(SIGTTIN, SIG_DFL); |
(void)signal(SIGTTIN, SIG_DFL); |
if (c == EOF && ferror(stdin)) { |
if (c == EOF && ferror(stdin)) { |
redo: |
redo: |
cp = strlen(canonb) > 0 ? canonb : NULL; |
cp = strlen(canonb) > 0 ? canonb : NULL; |
|
|
sig_t old_action = signal(s, SIG_DFL); |
sig_t old_action = signal(s, SIG_DFL); |
sigset_t nset; |
sigset_t nset; |
|
|
sigemptyset(&nset); |
(void)sigemptyset(&nset); |
sigaddset(&nset, s); |
(void)sigaddset(&nset, s); |
sigprocmask(SIG_UNBLOCK, &nset, NULL); |
(void)sigprocmask(SIG_UNBLOCK, &nset, NULL); |
kill(0, s); |
(void)kill(0, s); |
sigprocmask(SIG_BLOCK, &nset, NULL); |
(void)sigprocmask(SIG_BLOCK, &nset, NULL); |
signal(s, old_action); |
(void)signal(s, old_action); |
siglongjmp(rewrite, 1); |
siglongjmp(rewrite, 1); |
} |
} |
|
|