Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-03-12 09:29:54 +0300
committerChristopher Faylor <me@cgf.cx>2000-03-12 09:29:54 +0300
commit3f0b4935404f01ab19ecab559a3201d4bb1ec5ca (patch)
treecc60ec7a05e57f8a4049bff0959bdd3ae24ae04c /winsup/cygwin/select.cc
parent774ea162116fcb08278c5efbe287848f5b5dd431 (diff)
* fhandler.cc (fhandler_base::get_readahead_into_buffer): New function.
* fhandler.h: Declare new function. Add extra argument to process_slave_output. * fhandler_console.cc (fhandler_console::read): Move read ahead code to new function. * fhandler_tty.cc (fhandler_pty_master::process_slave_output): Move common code here. (fhandler_tty_slave::read): Understand readahead. (fhandler_pty_master::read): Move code to process_slave_output. * select.cc (peek_pipe): Avoid performing certain checks when non-read and on inappropriate fh types.
Diffstat (limited to 'winsup/cygwin/select.cc')
-rw-r--r--winsup/cygwin/select.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index b3d35606e..5067006fa 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -409,20 +409,24 @@ peek_pipe (select_record *s, int ignra)
if (!s->read_selected && !s->except_selected)
goto out;
- if (s->read_selected && fh->bg_check (SIGTTIN) <= 0)
+ if (s->read_selected)
{
- gotone = s->read_ready = 1;
- goto out;
- }
+ if (fh->bg_check (SIGTTIN) <= 0)
+ {
+ gotone = s->read_ready = 1;
+ goto out;
+ }
- if (!ignra && fh->get_readahead_valid ())
- {
- select_printf ("readahead");
- gotone = s->read_ready = 1;
- goto out;
+ if (!ignra && fh->get_device () != FH_PTYM && fh->get_device () != FH_TTYM &&
+ fh->get_readahead_valid ())
+ {
+ select_printf ("readahead");
+ gotone = s->read_ready = 1;
+ goto out;
+ }
}
- else if (!PeekNamedPipe (h, NULL, 0, NULL, (DWORD *) &n, NULL))
+ if (!PeekNamedPipe (h, NULL, 0, NULL, (DWORD *) &n, NULL))
{
select_printf ("%s, PeekNamedPipe failed, %E", fh->get_name ());
n = -1;