diff options
author | brian <brian@cvs.openbsd.org> | 1999-05-27 08:45:00 +0000 |
---|---|---|
committer | brian <brian@cvs.openbsd.org> | 1999-05-27 08:45:00 +0000 |
commit | 7fa2747dade3eacc892d119a29a550fabc70bc8a (patch) | |
tree | e9e0e6fcdb1855267cc5909279fa362635e42a93 | |
parent | 6a1a701c0238291409405f33987e836f46173ee9 (diff) |
Call tty_Offline() from tty_Cooked() and tty_Free(), just in
case ppp is abending and hasn't called physical_Offline()
already.
-rw-r--r-- | usr.sbin/ppp/ppp/tty.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/ppp/ppp/tty.c b/usr.sbin/ppp/ppp/tty.c index cf992c43725..c9fd1476d48 100644 --- a/usr.sbin/ppp/ppp/tty.c +++ b/usr.sbin/ppp/ppp/tty.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: tty.c,v 1.7 1999/05/24 16:39:19 brian Exp $ + * $Id: tty.c,v 1.8 1999/05/27 08:44:59 brian Exp $ */ #include <sys/param.h> @@ -238,6 +238,8 @@ tty_Cooked(struct physical *p) struct ttydevice *dev = device2tty(p->handler); int oldflag; + tty_Offline(p); /* In case of emergency close()s */ + tcflush(p->fd, TCIOFLUSH); if (!physical_IsSync(p)) { tcsetattr(p->fd, TCSAFLUSH, &dev->ios); @@ -260,6 +262,7 @@ tty_Free(struct physical *p) { struct ttydevice *dev = device2tty(p->handler); + tty_Offline(p); /* In case of emergency close()s */ free(dev); } |