summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2019-03-11 17:13:32 +0000
committeranton <anton@cvs.openbsd.org>2019-03-11 17:13:32 +0000
commit8e520e7296a7e0eb0b77435e9b5f467bf11cf292 (patch)
treec935170425bf4a033f85ed3f23d7089438c8c914 /sys/kern
parentc6b06d2a551512f8e30a352221f766397fc5ae9b (diff)
Bring back revision 1.91 now that vmd has been fixed, repeating the
previous commit message: When closing the slave end of a pty, generate an EOF event to any kqueue consumer of the master end. This behavior is equivalent to how pipes already behave with kqueue. Also, FreeBSD and NetBSD behaves the same way. ok deraadt@ millert@ visa@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/tty_pty.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 51daa1385a4..f09fb28df82 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.92 2019/03/06 09:36:27 tb Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.93 2019/03/11 17:13:31 anton Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -678,6 +678,12 @@ filt_ptcread(struct knote *kn, long hint)
((pti->pt_flags & PF_UCNTL) && pti->pt_ucntl))
kn->kn_data++;
}
+
+ if (!ISSET(tp->t_state, TS_CARR_ON)) {
+ kn->kn_flags |= EV_EOF;
+ return (1);
+ }
+
return (kn->kn_data > 0);
}