Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110098665
D41605.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41605.diff
View Options
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -253,9 +253,6 @@
ttyoutq_free(&tp->t_outq);
tp->t_outlow = 0;
- knlist_clear(&tp->t_inpoll.si_note, 1);
- knlist_clear(&tp->t_outpoll.si_note, 1);
-
if (!tty_gone(tp))
ttydevsw_close(tp);
@@ -369,7 +366,7 @@
static int
ttydev_close(struct cdev *dev, int fflag, int devtype __unused,
- struct thread *td __unused)
+ struct thread *td)
{
struct tty *tp = dev->si_drv1;
@@ -392,8 +389,11 @@
}
/* If revoking, flush output now to avoid draining it later. */
- if (fflag & FREVOKE)
+ if ((fflag & FREVOKE) != 0) {
tty_flush(tp, FWRITE);
+ knlist_delete(&tp->t_inpoll.si_note, td, 1);
+ knlist_delete(&tp->t_outpoll.si_note, td, 1);
+ }
tp->t_flags &= ~TF_EXCLUDE;
@@ -1120,6 +1120,8 @@
ttyoutq_free(&tp->t_outq);
seldrain(&tp->t_inpoll);
seldrain(&tp->t_outpoll);
+ knlist_clear(&tp->t_inpoll.si_note, 0);
+ knlist_clear(&tp->t_outpoll.si_note, 0);
knlist_destroy(&tp->t_inpoll.si_note);
knlist_destroy(&tp->t_outpoll.si_note);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 14, 2:37 PM (21 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16643849
Default Alt Text
D41605.diff (1 KB)
Attached To
Mode
D41605: tty: delete knotes when TTY is revoked
Attached
Detach File
Event Timeline
Log In to Comment