diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-12-01 07:51:48 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-12-01 07:51:48 +0000 |
commit | caade4c1f10e3d0c5156f58840496c3c654d7db6 (patch) | |
tree | 4832a2166fd90fec9eab83264953b7e08dfd8390 /sys | |
parent | a8fc2e3d4bcb6ad6dd3f05a3a8057957a59cfca2 (diff) |
clist's chained, and could get fairly long which is why there was a
dynamic clamping mechanism. In the (new? has it already been 20 years?)
world of tty ring buffers, c_cn is the maximum...
There could be some ugly limit elsewhere, which may cause a deadlock
(dug as deep as my patience allows), so please report any sort
of new console or xterm issues that show up, such as tty lockups or high
cpu utilization..
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/tty.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index de83fdea476..1c7ba6bffac 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.115 2014/11/18 01:59:58 tedu Exp $ */ +/* $OpenBSD: tty.c,v 1.116 2014/12/01 07:51:47 deraadt Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -2091,15 +2091,14 @@ ttspeedtab(int speed, const struct speedtab *table) void ttsetwater(struct tty *tp) { - int cps, x, omost; + int cps, x; #define CLAMP(x, h, l) ((x) > h ? h : ((x) < l) ? l : (x)) cps = tp->t_ospeed / 10; tp->t_lowat = x = CLAMP(cps / 2, TTMAXLOWAT, TTMINLOWAT); x += cps; - omost = MIN(tp->t_outq.c_cn - 200, tp->t_outq.c_cn); - tp->t_hiwat = CLAMP(x, omost, 100); + tp->t_hiwat = CLAMP(x, tp->t_outq.c_cn, 100); #undef CLAMP } |