FreeBSD Bugzilla – Attachment 129058 Details for
Bug 173010
Backgrounded processes remain in ttyin state / SIGCONT does not remove sleeping processes from sleep queue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
tty-bg-read.txt
tty-bg-read.txt (text/plain; charset=us-ascii), 2.18 KB, created by
Jeremy Chadwick
on 2012-10-25 09:51:45 UTC
(
hide
)
Description:
tty-bg-read.txt
Filename:
MIME Type:
Creator:
Jeremy Chadwick
Created:
2012-10-25 09:51:45 UTC
Size:
2.18 KB
patch
obsolete
>Index: sys/kern/tty.c >=================================================================== >--- sys/kern/tty.c (Revision 241962) >+++ sys/kern/tty.c (Arbeitskopie) >@@ -361,7 +361,7 @@ > 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 @@ > 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); > >Index: sys/kern/tty_ttydisc.c >=================================================================== >--- sys/kern/tty_ttydisc.c (Revision 241962) >+++ sys/kern/tty_ttydisc.c (Arbeitskopie) >@@ -126,6 +126,10 @@ > breakc[n] = '\0'; > > do { >+ error = tty_wait_background(tp, curthread, SIGTTIN); >+ if (error) >+ return (error); >+ > /* > * Quite a tricky case: unlike the old TTY > * implementation, this implementation copies data back >@@ -192,6 +196,10 @@ > */ > > for (;;) { >+ error = tty_wait_background(tp, curthread, SIGTTIN); >+ if (error) >+ return (error); >+ > error = ttyinq_read_uio(&tp->t_inq, tp, uio, > uio->uio_resid, 0); > if (error) >@@ -229,6 +237,10 @@ > timevaladd(&end, &now); > > for (;;) { >+ error = tty_wait_background(tp, curthread, SIGTTIN); >+ if (error) >+ return (error); >+ > error = ttyinq_read_uio(&tp->t_inq, tp, uio, > uio->uio_resid, 0); > if (error) >@@ -278,6 +290,10 @@ > */ > > for (;;) { >+ error = tty_wait_background(tp, curthread, SIGTTIN); >+ if (error) >+ return (error); >+ > error = ttyinq_read_uio(&tp->t_inq, tp, uio, > uio->uio_resid, 0); > if (error) >Index: sys/sys/tty.h >=================================================================== >--- sys/sys/tty.h (Revision 241962) >+++ sys/sys/tty.h (Arbeitskopie) >@@ -180,6 +180,7 @@ > void tty_signal_pgrp(struct tty *tp, int signal); > /* Waking up readers/writers. */ > int tty_wait(struct tty *tp, struct cv *cv); >+int tty_wait_background(struct tty *tp, struct thread *td, int sig); > int tty_timedwait(struct tty *tp, struct cv *cv, int timo); > void tty_wakeup(struct tty *tp, int flags); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 173010
: 129058