]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-bsd.c
add defns for debug stuff
[ppp.git] / pppd / sys-bsd.c
index c884a62914a94cff32294191f4739003a2ca087c..1a7c83a6827a505026ee8b591f13c57ecf872099 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.19 1995/05/19 03:27:03 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");
@@ -341,10 +350,8 @@ read_packet(buf)
     int len;
 
     if ((len = read(fd, buf, PPP_MTU + PPP_HDRLEN)) < 0) {
-       if (errno == EWOULDBLOCK || errno == EINTR) {
-           MAINDEBUG((LOG_DEBUG, "read(fd): %m"));
+       if (errno == EWOULDBLOCK || errno == EINTR)
            return -1;
-       }
        syslog(LOG_ERR, "read(fd): %m");
        die(1);
     }