Call tty_Offline() from tty_Cooked() and tty_Free(), just in

case ppp is abending and hasn't called physical_Offline()
already.
This commit is contained in:
Brian Somers 1999-05-27 08:42:49 +00:00
parent 4e5196e9dc
commit d0b3b745ba

View File

@ -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);
}