X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-bsd.c;h=e9dcd5af7f60f0214ba08a6682e5871da6fd9268;hb=d225d79347bab49e41ec4192e8d3f0ee63702d9c;hp=4dbb9d7970a8ac2a7aa050974f11b16d776ddc4e;hpb=ca37fc1452ca1ae6e47e52bea31ffa8ed2d970f4;p=ppp.git diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index 4dbb9d7..e9dcd5a 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.18 1995/05/01 00:23:53 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.20 1995/08/11 02:36:21 paulus Exp $"; #endif /* @@ -57,6 +57,7 @@ static int rtm_seq; static int restore_term; /* 1 => we've munged the terminal */ static struct termios inittermios; /* Initial TTY termios */ +static struct winsize wsinfo; /* Initial window size info */ static char *lock_file; /* name of lock file created */ @@ -213,8 +214,10 @@ set_up_tty(fd, local) die(1); } - if (!restore_term) + if (!restore_term) { inittermios = tios; + ioctl(fd, TIOCGWINSZ, &wsinfo); + } tios.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL); if (crtscts > 0) @@ -281,6 +284,7 @@ restore_tty() if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); + ioctl(fd, TIOCSWINSZ, &wsinfo); restore_term = 0; } } @@ -350,10 +354,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); }