]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-bsd.c
leave tty with echo turned off if not default device
[ppp.git] / pppd / sys-bsd.c
index c884a62914a94cff32294191f4739003a2ca087c..4dbb9d7970a8ac2a7aa050974f11b16d776ddc4e 100644 (file)
@@ -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");