diff options
author | ed <ed@FreeBSD.org> | 2009-08-02 14:25:26 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-08-02 14:25:26 +0000 |
commit | ea03af42ccd07d2533707afe4d1ba08f34bdb2e9 (patch) | |
tree | 83f37a3195c24783ffcfba938ae2aefa103541ad /sys/kern/tty_ttydisc.c | |
parent | c5b1acbb23e59bea7d9025852bb9c14a0bc5b69a (diff) | |
download | FreeBSD-src-ea03af42ccd07d2533707afe4d1ba08f34bdb2e9.zip FreeBSD-src-ea03af42ccd07d2533707afe4d1ba08f34bdb2e9.tar.gz |
Fix two bugs related to TTY input:
- fix write() on pseudo-terminal masters to return the amount of bytes
passed to the TTY, not the amount of bytes read from user.
- fix ttydisc_rint_bypass() to set the high watermark when it cannot
write all input, just like ttydisc_rint() itself.
Approved by: re (kib)
Diffstat (limited to 'sys/kern/tty_ttydisc.c')
-rw-r--r-- | sys/kern/tty_ttydisc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index 634b58e..debaa1c 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -1060,6 +1060,8 @@ ttydisc_rint_bypass(struct tty *tp, const void *buf, size_t len) ret = ttyinq_write(&tp->t_inq, buf, len, 0); ttyinq_canonicalize(&tp->t_inq); + if (ret < len) + tty_hiwat_in_block(tp); return (ret); } |