summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/tty.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-05-27 08:42:49 +0000
committerbrian <brian@FreeBSD.org>1999-05-27 08:42:49 +0000
commite6e17ede1c660e37c4cb743913856592e2a2834d (patch)
tree96ec907d1b2e7941edc417ec8a98017330631423 /usr.sbin/ppp/tty.c
parentd317a05c142bfd45e1daa20780e105a9336fe9fb (diff)
downloadFreeBSD-src-e6e17ede1c660e37c4cb743913856592e2a2834d.zip
FreeBSD-src-e6e17ede1c660e37c4cb743913856592e2a2834d.tar.gz
Call tty_Offline() from tty_Cooked() and tty_Free(), just in
case ppp is abending and hasn't called physical_Offline() already.
Diffstat (limited to 'usr.sbin/ppp/tty.c')
-rw-r--r--usr.sbin/ppp/tty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/ppp/tty.c b/usr.sbin/ppp/tty.c
index e8ace57..c8a2c9a 100644
--- a/usr.sbin/ppp/tty.c
+++ b/usr.sbin/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.6 1999/05/18 01:37:46 brian Exp $
+ * $Id: tty.c,v 1.7 1999/05/24 16:39:16 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);
}
OpenPOWER on IntegriCloud