summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-05-27 08:45:00 +0000
committerbrian <brian@cvs.openbsd.org>1999-05-27 08:45:00 +0000
commit7fa2747dade3eacc892d119a29a550fabc70bc8a (patch)
treee9e0e6fcdb1855267cc5909279fa362635e42a93
parent6a1a701c0238291409405f33987e836f46173ee9 (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.c5
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);
}