* pinfo.h (class push_process_state): New class to push a process state

flag temporarily into myself->process_state.
	* fhandler_console.cc (fhandler_console::read): Add push_process_state
	handler.
	(fhandler_console::write): Call bg_check from here.  Add
	push_process_state handler.
	* fhandler_tty.cc (fhandler_tty_slave::write): Ditto.
	(fhandler_tty_slave::read): Ditto.
	(fhandler_pty_master::write): Ditto.
	(fhandler_pty_master::read): Ditto.
	* syscalls.cc (readv): Remove bg_check call and setting process state.
	(writev): Ditto.
This commit is contained in:
Corinna Vinschen
2011-05-05 19:43:04 +00:00
parent 23db0a41d8
commit d8ff96389f
5 changed files with 73 additions and 19 deletions

View File

@@ -994,17 +994,7 @@ readv (int fd, const struct iovec *const iov, const int iovcnt)
while (1)
{
/* Check to see if this is a background read from a "tty",
sending a SIGTTIN, if appropriate */
res = cfd->bg_check (SIGTTIN);
if (res > bg_eof)
{
myself->process_state |= PID_TTYIN;
res = cfd->readv (iov, iovcnt, tot);
myself->process_state &= ~PID_TTYIN;
}
res = cfd->readv (iov, iovcnt, tot);
if (res >= 0 || get_errno () != EINTR || !_my_tls.call_signal_handler ())
break;
set_errno (e);
@@ -1051,14 +1041,7 @@ writev (const int fd, const struct iovec *const iov, const int iovcnt)
else
syscall_printf ("writev (%d, %p, %d)", fd, iov, iovcnt);
res = cfd->bg_check (SIGTTOU);
if (res > (int) bg_eof)
{
myself->process_state |= PID_TTYOU;
res = cfd->writev (iov, iovcnt, tot);
myself->process_state &= ~PID_TTYOU;
}
res = cfd->writev (iov, iovcnt, tot);
done:
if (fd == 1 || fd == 2)