diff options
author | ache <ache@FreeBSD.org> | 1996-03-29 15:24:04 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-03-29 15:24:04 +0000 |
commit | 92cff4dcbb07770905a96ab952815ab50e1b9675 (patch) | |
tree | 2042e03fd6bd7e9e20256ff56895675d4bb3b1af /usr.sbin | |
parent | b80fd56bd8648763726b1962de2532b3db6c29d0 (diff) | |
download | FreeBSD-src-92cff4dcbb07770905a96ab952815ab50e1b9675.zip FreeBSD-src-92cff4dcbb07770905a96ab952815ab50e1b9675.tar.gz |
Fix UnrawModem:
restore initial (not second level) state
not call it for DEV_SYNC
issue input flush after restoring
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/modem.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index 057ac7b..0430741 100644 --- a/usr.sbin/ppp/modem.c +++ b/usr.sbin/ppp/modem.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: modem.c,v 1.21 1996/03/27 22:58:21 ache Exp $ + * $Id: modem.c,v 1.22 1996/03/28 13:38:59 ache Exp $ * * TODO: */ @@ -369,6 +369,8 @@ char *host, *port; return(sock); } +static struct termios modemios; + int OpenModem(mode) int mode; @@ -439,6 +441,7 @@ int mode; sleep(1); if (dev_is_modem && !DEV_IS_SYNC) { tcgetattr(modem, &rstio); + modemios = rstio; #ifdef DEBUG logprintf("## modem = %d\n", modem); logprintf("modem (get): iflag = %x, oflag = %x, cflag = %x\n", @@ -491,8 +494,6 @@ ModemSpeed() return(SpeedToInt(cfgetispeed(&rstio))); } -static struct termios modemios; - /* * Put modem tty line into raw mode which is necessary in packet mode operation */ @@ -514,7 +515,6 @@ int modem; #endif } tcgetattr(modem, &rstio); - modemios = rstio; cfmakeraw(&rstio); #ifdef USE_CTSRTS rstio.c_cflag |= CLOCAL | CCTS_OFLOW|CRTS_IFLOW; @@ -541,8 +541,8 @@ int modem; { int oldflag; - if (isatty(modem)) { - tcsetattr(modem, TCSADRAIN, &modemios); + if (isatty(modem) && !DEV_IS_SYNC) { + tcsetattr(modem, TCSAFLUSH, &modemios); oldflag = fcntl(modem, F_GETFL, 0); fcntl(modem, F_SETFL, oldflag & ~O_NONBLOCK); } |