* 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

@@ -224,6 +224,23 @@ cygwin_pid (pid_t pid)
void __stdcall pinfo_init (char **, int);
extern pinfo myself;
/* Helper class to allow convenient setting and unsetting a process_state
flag in myself. This is used in certain fhandler read/write methods
to set the PID_TTYIN/PID_TTYOU flags in myself->process_state. */
class push_process_state
{
private:
int flag;
public:
push_process_state (int add_flag)
{
flag = add_flag;
myself->process_state |= flag;
}
void pop () { myself->process_state &= ~(flag); }
~push_process_state () { pop (); }
};
#define _P_VFORK 0
#define _P_SYSTEM 512
/* Add this flag in calls to spawn_guts if the calling function is one of