X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-bsd.c;h=1a7c83a6827a505026ee8b591f13c57ecf872099;hp=c884a62914a94cff32294191f4739003a2ca087c;hb=9bdc1c0aae8aa1179b021d0762ac3f98acc78836;hpb=15f70676e19cc40b697b30ac2ede10909615d94f diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index c884a62..1a7c83a 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.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); }