aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2003-06-22 02:54:33 +0000
committerIan Dowse <iedowse@FreeBSD.org>2003-06-22 02:54:33 +0000
commitd29bf12ff8af22103581957d676732a09eec7e19 (patch)
tree68d45a057c7fb88626bb480c259807ef2a5bf778 /sys/kern/tty.c
parent7ca33ad1e88de79ac6dcbb6a30b8f199e72cf964 (diff)
downloadsrc-d29bf12ff8af22103581957d676732a09eec7e19.tar.gz
src-d29bf12ff8af22103581957d676732a09eec7e19.zip
Use a new message buffer `consmsgbuf' to forward messages to a
TIOCCONS console (e.g. xconsole) via a timeout routine instead of calling into the tty code directly from printf(). This fixes a number of cases where calling printf() at the wrong time (such as with locks held) would cause a panic if xconsole is running. The TIOCCONS message buffer is 8k in size by default, but this can be changed with the kern.consmsgbuf_size sysctl. By default, messages are checked for 5 times per second. The timer runs and the buffer memory remains allocated only at times when a TIOCCONS console is active. Discussed on: freebsd-arch
Notes
Notes: svn path=/head/; revision=116663
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 1c8aa6bcce5b..4bebd65cf969 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -261,7 +261,7 @@ ttyclose(struct tty *tp)
funsetown(&tp->t_sigio);
s = spltty();
if (constty == tp)
- constty = NULL;
+ constty_clear();
ttyflush(tp, FREAD | FWRITE);
clist_free_cblocks(&tp->t_canq);
@@ -871,9 +871,9 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag)
if (error)
return (error);
- constty = tp;
+ constty_set(tp);
} else if (tp == constty)
- constty = NULL;
+ constty_clear();
break;
case TIOCDRAIN: /* wait till output drained */
error = ttywait(tp);