summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-03 20:55:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-03 20:55:30 +0000
commit7ce6c6c15ad0a4ae329e52cd49c832804ac2bd6c (patch)
treea9e728ebd0fcb58e1560a56f7e0bfa523b65642a /sys/dev
parentc2d82ee48f06bdd997e99e5903a7d279737aaf9e (diff)
fix cua/tty locking
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/com.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index e8622f90c1b..2a41167100f 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.35 1997/07/07 16:37:12 niklas Exp $ */
+/* $OpenBSD: com.c,v 1.36 1997/09/03 20:55:28 deraadt Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*-
@@ -654,12 +654,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 */
@@ -669,6 +671,8 @@ comopen(dev, flag, mode, p)
splx(s);
return error;
}
+ if (!DEVCUA(dev) && sc->sc_cua)
+ continue;
}
}
splx(s);