From 7ce6c6c15ad0a4ae329e52cd49c832804ac2bd6c Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 3 Sep 1997 20:55:30 +0000 Subject: fix cua/tty locking --- sys/arch/i386/isa/pccom.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/arch/i386/isa') diff --git a/sys/arch/i386/isa/pccom.c b/sys/arch/i386/isa/pccom.c index 07c14f2e873..b09e7790196 100644 --- a/sys/arch/i386/isa/pccom.c +++ b/sys/arch/i386/isa/pccom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccom.c,v 1.11 1997/07/07 17:08:04 niklas Exp $ */ +/* $OpenBSD: pccom.c,v 1.12 1997/09/03 20:55:29 deraadt Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /*- @@ -838,12 +838,14 @@ comopen(dev, flag, mode, p) return EBUSY; } } else { - while (!(DEVCUA(dev) && sc->sc_cua) && - !ISSET(tp->t_cflag, CLOCAL) && - !ISSET(tp->t_state, TS_CARR_ON)) { + while (sc->sc_cua || + (!ISSET(tp->t_cflag, CLOCAL) && + !ISSET(tp->t_state, TS_CARR_ON))) { SET(tp->t_state, TS_WOPEN); error = ttysleep(tp, &tp->t_rawq, TTIPRI | PCATCH, ttopen, 0); + if (!DEVCUA(dev) && sc->sc_cua && error == EINTR) + continue; if (error) { /* XXX should turn off chip if we're the only waiter */ @@ -853,6 +855,8 @@ comopen(dev, flag, mode, p) splx(s); return error; } + if (!DEVCUA(dev) && sc->sc_cua) + continue; } } splx(s); -- cgit v1.2.3