summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pts.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-12-21 21:16:57 +0000
committered <ed@FreeBSD.org>2008-12-21 21:16:57 +0000
commit8cd1b937417632dbc19c54113e5fad066faa9952 (patch)
tree8434e826bf24020020d358447548538cc5b81047 /sys/kern/tty_pts.c
parent63e9bb0efa27c0ce3aad11403d5145b46448135a (diff)
downloadFreeBSD-src-8cd1b937417632dbc19c54113e5fad066faa9952.zip
FreeBSD-src-8cd1b937417632dbc19c54113e5fad066faa9952.tar.gz
Set PTS_FINISHED before waking up any threads.
Inside ptsdrv_{in,out}wakeup() we call KNOTE_LOCKED() to wake up any kevent(2) users. Because the kqueue handlers are executed synchronously, we must set PTS_FINISHED before calling ptsdrv_{in,out}wakeup(). Discovered by: nork
Diffstat (limited to 'sys/kern/tty_pts.c')
-rw-r--r--sys/kern/tty_pts.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c
index c767daa..49ea84c 100644
--- a/sys/kern/tty_pts.c
+++ b/sys/kern/tty_pts.c
@@ -630,10 +630,9 @@ ptsdrv_close(struct tty *tp)
struct pts_softc *psc = tty_softc(tp);
/* Wake up any blocked readers/writers. */
+ psc->pts_flags |= PTS_FINISHED;
ptsdrv_outwakeup(tp);
ptsdrv_inwakeup(tp);
-
- psc->pts_flags |= PTS_FINISHED;
}
static void
OpenPOWER on IntegriCloud