aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDiomidis Spinellis <dds@FreeBSD.org>2004-11-11 16:10:54 +0000
committerDiomidis Spinellis <dds@FreeBSD.org>2004-11-11 16:10:54 +0000
commita04b2130a0cf95d2ea170f393a5749404405e2b7 (patch)
tree894393aabd7ff08c0225ccad5b96e81e379712ea /sys
parenta1d77c4e0171b61d3be0c7b241d2cec2284abc36 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 171be8f5b3b9..0793e1f3db72 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1283,19 +1283,20 @@ ttypoll(struct cdev *dev, int events, struct thread *td)
s = spltty();
if (events & (POLLIN | POLLRDNORM)) {
- if (ttnread(tp) > 0 || ISSET(tp->t_state, TS_ZOMBIE))
+ if (ttnread(tp) > 0)
revents |= events & (POLLIN | POLLRDNORM);
else
selrecord(td, &tp->t_rsel);
}
if (events & (POLLOUT | POLLWRNORM)) {
- if ((tp->t_outq.c_cc <= tp->t_olowat &&
- ISSET(tp->t_state, TS_CONNECTED))
- || ISSET(tp->t_state, TS_ZOMBIE))
+ if (tp->t_outq.c_cc <= tp->t_olowat &&
+ ISSET(tp->t_state, TS_CONNECTED))
revents |= events & (POLLOUT | POLLWRNORM);
else
selrecord(td, &tp->t_wsel);
}
+ if (ISSET(tp->t_state, TS_ZOMBIE))
+ revents |= POLLERR;
splx(s);
return (revents);
}