summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2008-10-21 14:18:45 +0000
committerthompsa <thompsa@FreeBSD.org>2008-10-21 14:18:45 +0000
commit8ee58ba9e66f5d9293a780c100118b57f0cdfd22 (patch)
tree7ceae17e8dfadf4ace95d3683bc5c1a433be01e0 /sys/kern/tty.c
parentd9ae813ea1e74131d4bd84b8bfa77da974d580eb (diff)
downloadFreeBSD-src-8ee58ba9e66f5d9293a780c100118b57f0cdfd22.zip
FreeBSD-src-8ee58ba9e66f5d9293a780c100118b57f0cdfd22.tar.gz
If we have getc_inject hooked then the outq buffer is inaccessible to the
driver so skip the drain rather than waiting indefinitely. Reviewed by: ed
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index ef9818b..6c2553a 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -119,6 +119,10 @@ tty_drain(struct tty *tp)
{
int error;
+ if (ttyhook_hashook(tp, getc_inject))
+ /* buffer is inaccessable */
+ return (0);
+
while (ttyoutq_bytesused(&tp->t_outq) > 0) {
ttydevsw_outwakeup(tp);
/* Could be handled synchronously. */
OpenPOWER on IntegriCloud