Don't raise SIGTTIN from poll/select

SIGTTIN should be raised when read() is made on a tty in a backgrounded
process, but not when it's tested with poll()/select().

I guess poll()/select() does need to call bg_check(), in order to detect the
error conditions that notices (that is, if bg_check() returns bg_eof or
bg_error, then fd is ready as an error condition exists) so add an optional
parameter to fhandler_base::bg_select() to indicate that signals aren't
desired.

See https://cygwin.com/ml/cygwin-developers/2016-07/msg00004.html
This commit is contained in:
Corinna Vinschen
2016-07-26 19:03:07 +01:00
committed by Jon Turney
parent 10a30e7a25
commit 32b668d966
3 changed files with 41 additions and 10 deletions

View File

@ -427,7 +427,7 @@ public:
{
return dev ().native ();
}
virtual bg_check_types bg_check (int) {return bg_ok;}
virtual bg_check_types bg_check (int, bool = false) {return bg_ok;}
void clear_readahead ()
{
raixput = raixget = ralen = rabuflen = 0;
@ -1233,7 +1233,7 @@ class fhandler_termios: public fhandler_base
void sigflush ();
int tcgetpgrp ();
int tcsetpgrp (int pid);
bg_check_types bg_check (int sig);
bg_check_types bg_check (int sig, bool dontsignal = false);
virtual DWORD __acquire_output_mutex (const char *fn, int ln, DWORD ms) {return 1;}
virtual void __release_output_mutex (const char *fn, int ln) {}
void echo_erase (int force = 0);