diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-06 09:52:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-06 09:52:08 +0000 |
commit | a3b47a0577759ba42d64a2de77851874a2cffb38 (patch) | |
tree | 9ec9c45fc533e7f4e005f4c1eed7b57196a9a83c | |
parent | 946b18ce9b078a9105824fdba385201a3072c196 (diff) |
catq: must spltty before playing
-rw-r--r-- | sys/kern/tty_subr.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index a3398117df9..92ad0c790f0 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_subr.c,v 1.3 1996/06/05 22:56:43 deraadt Exp $ */ +/* $OpenBSD: tty_subr.c,v 1.4 1996/06/06 09:52:07 deraadt Exp $ */ /* $NetBSD: tty_subr.c,v 1.13 1996/02/09 19:00:43 christos Exp $ */ /* @@ -549,9 +549,13 @@ catq(from, to) struct clist *from, *to; { int c; + int s; - if (from->c_cc == 0) /* nothing to move */ + s = spltty(); + if (from->c_cc == 0) { /* nothing to move */ + splx(s); return; + } /* * if `to' queue is empty and the queues are the same max size, @@ -563,7 +567,10 @@ catq(from, to) tmp = *from; *from = *to; *to = tmp; + splx(s); + return; } + splx(s); while ((c = getc(from)) != -1) putc(c, to); |