X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-bsd.c;h=eea6125b3352535cab75ede48b0f7b337f0427b6;hp=1a7c83a6827a505026ee8b591f13c57ecf872099;hb=c0c6e678b9469b9d867cff36dbd4d915f8ac46b5;hpb=6eaa844bcf1928f8a9e433a6e66a0f98d8a11655 diff --git a/pppd/sys-bsd.c b/pppd/sys-bsd.c index 1a7c83a..eea6125 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.19 1995/05/19 03:27:03 paulus Exp $"; +static char rcsid[] = "$Id: sys-bsd.c,v 1.21 1995/08/16 01:40:23 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 */ @@ -103,14 +104,19 @@ ppp_available() { int s, ok; struct ifreq ifr; + extern char *no_ppp_msg; if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - return 1; /* can't tell - maybe we're not root */ + return 1; /* can't tell */ strncpy(ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name)); ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0; close(s); + no_ppp_msg = "\ +This system lacks kernel support for PPP. To include PPP support\n\ +in the kernel, please follow the steps detailed in the README.bsd\n\ +file in the ppp-2.2 distribution.\n"; return ok; } @@ -213,8 +219,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 +289,7 @@ restore_tty() if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) if (errno != ENXIO) syslog(LOG_WARNING, "tcsetattr: %m"); + ioctl(fd, TIOCSWINSZ, &wsinfo); restore_term = 0; } }