From ca37fc1452ca1ae6e47e52bea31ffa8ed2d970f4 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 1 May 1995 00:26:22 +0000 Subject: [PATCH] leave tty with echo turned off if not default device --- pppd/sys-aix4.c | 11 ++++++++++- pppd/sys-bsd.c | 11 ++++++++++- pppd/sys-linux.c | 9 +++++++++ pppd/sys-osf.c | 11 ++++++++++- pppd/sys-str.c | 11 ++++++++++- pppd/sys-ultrix.c | 11 ++++++++++- 6 files changed, 59 insertions(+), 5 deletions(-) diff --git a/pppd/sys-aix4.c b/pppd/sys-aix4.c index b6485ec..ca9cebc 100644 --- a/pppd/sys-aix4.c +++ b/pppd/sys-aix4.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-aix4.c,v 1.5 1995/04/28 06:25:40 paulus Exp $"; +static char rcsid[] = "$Id: sys-aix4.c,v 1.6 1995/05/01 00:26:11 paulus Exp $"; #endif /* @@ -463,6 +463,15 @@ void restore_tty() { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index c884a62..4dbb9d7 100644 --- a/pppd/sys-bsd.c +++ b/pppd/sys-bsd.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-bsd.c,v 1.17 1995/04/27 00:33:39 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.18 1995/05/01 00:23:53 paulus Exp $"; #endif /* @@ -269,6 +269,15 @@ void restore_tty() { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index 946a2f9..9f04976 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -399,6 +399,15 @@ void setdtr (int fd, int on) void restore_tty (void) { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index 8cd7710..5b1d2ab 100644 --- a/pppd/sys-osf.c +++ b/pppd/sys-osf.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-osf.c,v 1.3 1995/04/28 06:26:23 paulus Exp $"; +static char rcsid[] = "$Id: sys-osf.c,v 1.4 1995/05/01 00:26:01 paulus Exp $"; #endif /* @@ -587,6 +587,15 @@ void restore_tty() { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); diff --git a/pppd/sys-str.c b/pppd/sys-str.c index f5afba9..e583133 100644 --- a/pppd/sys-str.c +++ b/pppd/sys-str.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-str.c,v 1.19 1995/04/28 06:26:46 paulus Exp $"; +static char rcsid[] = "$Id: sys-str.c,v 1.20 1995/05/01 00:26:22 paulus Exp $"; #endif /* @@ -452,6 +452,15 @@ void restore_tty() { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); diff --git a/pppd/sys-ultrix.c b/pppd/sys-ultrix.c index 879aeda..46369e6 100644 --- a/pppd/sys-ultrix.c +++ b/pppd/sys-ultrix.c @@ -19,7 +19,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-ultrix.c,v 1.10 1995/04/28 06:26:57 paulus Exp $"; +static char rcsid[] = "$Id: sys-ultrix.c,v 1.11 1995/05/01 00:25:38 paulus Exp $"; #endif /* @@ -401,6 +401,15 @@ void restore_tty() { if (restore_term) { + if (!default_device) { + /* + * Turn off echoing, because otherwise we can get into + * a loop with the tty and the modem echoing to each other. + * We presume we are the sole user of this tty device, so + * when we close it, it will revert to its defaults anyway. + */ + inittermios.c_lflag &= ~(ECHO | ECHONL); + } if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); -- 2.39.2