summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-10-30 16:41:10 +0000
committernicm <nicm@openbsd.org>2009-10-30 16:41:10 +0000
commit0c71d0eb7380373959fec1452692a65ba1d8dedf (patch)
treef8bf83737e2e46f226be29b082c60626b0f13209
parentDon't do a double free, sys_getsockopt() will take care of freeing the (diff)
downloadwireguard-openbsd-0c71d0eb7380373959fec1452692a65ba1d8dedf.tar.xz
wireguard-openbsd-0c71d0eb7380373959fec1452692a65ba1d8dedf.zip
Add missing KNOTE() calls after selwakeup() in ptcread() (to wake up writers
after the master side of the pty has finished reading) and in ttyflush(). ok tedu millert
-rw-r--r--sys/kern/tty.c3
-rw-r--r--sys/kern/tty_pty.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 1d78066931a..e71dd941f9f 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.81 2009/10/28 16:56:46 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.82 2009/10/30 16:41:10 nicm Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -1246,6 +1246,7 @@ ttyflush(struct tty *tp, int rw)
FLUSHQ(&tp->t_outq);
wakeup((caddr_t)&tp->t_outq);
selwakeup(&tp->t_wsel);
+ KNOTE(&tp->t_wsel.si_note, 0);
}
splx(s);
}
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 784a237eb6c..e08db5a9c60 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.40 2009/10/14 07:19:05 nicm Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.41 2009/10/30 16:41:10 nicm Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -510,6 +510,7 @@ ptcread(dev_t dev, struct uio *uio, int flag)
wakeup(&tp->t_outq);
}
selwakeup(&tp->t_wsel);
+ KNOTE(&tp->t_wsel.si_note, 0);
}
if (bufcc)
bzero(buf, bufcc);