summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/select.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2016-07-26 19:03:07 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2016-07-27 17:02:08 +0100
commit32b668d966e5363e7a1e07c3bc70a799c4170675 (patch)
tree3e29cf3108b95912201653c1016e05d47e1fbfa0 /winsup/cygwin/select.cc
parent10a30e7a258f112c1ada37b12cee924c8575c8d2 (diff)
downloadcygnal-32b668d966e5363e7a1e07c3bc70a799c4170675.tar.gz
cygnal-32b668d966e5363e7a1e07c3bc70a799c4170675.tar.bz2
cygnal-32b668d966e5363e7a1e07c3bc70a799c4170675.zip
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
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 217544e2a..578973741 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -645,7 +645,7 @@ peek_pipe (select_record *s, bool from_select)
}
}
- if (fh->bg_check (SIGTTIN) <= bg_eof)
+ if (fh->bg_check (SIGTTIN, true) <= bg_eof)
{
gotone = s->read_ready = true;
goto out;
@@ -884,7 +884,7 @@ peek_console (select_record *me, bool)
set_handle_or_return_if_not_open (h, me);
for (;;)
- if (fh->bg_check (SIGTTIN) <= bg_eof)
+ if (fh->bg_check (SIGTTIN, true) <= bg_eof)
return me->read_ready = true;
else if (!PeekConsoleInput (h, &irec, 1, &events_read) || !events_read)
break;