summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-10-15 17:59:02 +0000
committerache <ache@FreeBSD.org>1994-10-15 17:59:02 +0000
commit32696c9c2e645fbbd09ce5cdabf2ca8325fa9a80 (patch)
tree3ec8b7ee967a76e1fca30933b0b45301f4080345 /sys/kern/tty.c
parentac384b2ac22a9a30375956119e82452bff0fbb73 (diff)
downloadFreeBSD-src-32696c9c2e645fbbd09ce5cdabf2ca8325fa9a80.zip
FreeBSD-src-32696c9c2e645fbbd09ce5cdabf2ca8325fa9a80.tar.gz
ttywait: check conditions again right after oproc
Obtained from: (I know, but can't say :-)
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index fb45cb9..2547085 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)tty.c 8.8 (Berkeley) 1/21/94
- * $Id: tty.c,v 1.9 1994/10/06 21:06:34 davidg Exp $
+ * $Id: tty.c,v 1.10 1994/10/08 22:33:39 phk Exp $
*/
#include <sys/param.h>
@@ -980,10 +980,13 @@ ttywait(tp)
(ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL))
&& tp->t_oproc) {
(*tp->t_oproc)(tp);
- SET(tp->t_state, TS_ASLEEP);
- error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0);
- if (error)
- break;
+ if ((tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY)) &&
+ (ISSET(tp->t_state, TS_CARR_ON) || ISSET(tp->t_cflag, CLOCAL))) {
+ SET(tp->t_state, TS_ASLEEP);
+ error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0);
+ if (error)
+ break;
+ }
}
splx(s);
return (error);
OpenPOWER on IntegriCloud