diff options
author | ed <ed@FreeBSD.org> | 2012-10-25 09:05:21 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-10-25 09:05:21 +0000 |
commit | ae88b227912c0ec48a0dde46fe47f423ca864059 (patch) | |
tree | 0b7387e61e42451b385944d1c8a832f952bfe5a3 /sys/kern/tty.c | |
parent | 3d11eb1465fb275027ac5463f340907bdc11a0ad (diff) | |
download | FreeBSD-src-ae88b227912c0ec48a0dde46fe47f423ca864059.zip FreeBSD-src-ae88b227912c0ec48a0dde46fe47f423ca864059.tar.gz |
Correct SIGTTIN handling.
In the old TTY layer, SIGTTIN was correctly handled like this:
while (data should be read) {
send SIGTTIN if not foreground process group
read data
}
In the new TTY layer, however, this behaviour was changed, based on a
false interpretation of the standard:
send SIGTTIN if not foreground process group
while (data should be read) {
read data
}
Correct this by pushing tty_wait_background() into the ttydisc_read_*()
functions.
Reported by: koitsu
PR: kern/173010
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index e9c0fb6..4da8d38 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -361,7 +361,7 @@ tty_is_ctty(struct tty *tp, struct proc *p) return (p->p_session == tp->t_session && p->p_flag & P_CONTROLT); } -static int +int tty_wait_background(struct tty *tp, struct thread *td, int sig) { struct proc *p = td->td_proc; @@ -433,13 +433,6 @@ ttydev_read(struct cdev *dev, struct uio *uio, int ioflag) error = ttydev_enter(tp); if (error) goto done; - - error = tty_wait_background(tp, curthread, SIGTTIN); - if (error) { - tty_unlock(tp); - goto done; - } - error = ttydisc_read(tp, uio, ioflag); tty_unlock(tp); |