mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 04:19:21 +08:00
* fhndler_tty.cc (andler_pty_master::process_slave_output): Make
interruptible and cancelable. Fix nonblocking case.
This commit is contained in:
parent
e4f70cddcd
commit
27dd7bfbcd
@ -1,3 +1,8 @@
|
||||
2011-05-02 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhndler_tty.cc (andler_pty_master::process_slave_output): Make
|
||||
interruptible and cancelable. Fix nonblocking case.
|
||||
|
||||
2011-05-02 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* fhandler_console.cc (fhandler_console::read): Make restartable and
|
||||
|
@ -305,16 +305,23 @@ fhandler_pty_master::process_slave_output (char *buf, size_t len, int pktmode_on
|
||||
if (hit_eof ())
|
||||
goto out;
|
||||
/* DISCARD (FLUSHO) and tcflush can finish here. */
|
||||
if (n == 0 && (get_ttyp ()->ti.c_lflag & FLUSHO || !buf))
|
||||
if ((get_ttyp ()->ti.c_lflag & FLUSHO || !buf))
|
||||
goto out;
|
||||
if (n == 0 && is_nonblocking ())
|
||||
if (is_nonblocking ())
|
||||
{
|
||||
set_errno (EAGAIN);
|
||||
rc = -1;
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
|
||||
Sleep (10);
|
||||
pthread_testcancel ();
|
||||
if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0
|
||||
&& !_my_tls.call_signal_handler ())
|
||||
{
|
||||
set_errno (EINTR);
|
||||
rc = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ReadFile (handle, outbuf, rlen, &n, NULL) == FALSE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user