* 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>
|
2011-05-02 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_console.cc (fhandler_console::read): Make restartable and
|
* 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 ())
|
if (hit_eof ())
|
||||||
goto out;
|
goto out;
|
||||||
/* DISCARD (FLUSHO) and tcflush can finish here. */
|
/* 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;
|
goto out;
|
||||||
if (n == 0 && is_nonblocking ())
|
if (is_nonblocking ())
|
||||||
{
|
{
|
||||||
set_errno (EAGAIN);
|
set_errno (EAGAIN);
|
||||||
rc = -1;
|
rc = -1;
|
||||||
break;
|
goto out;
|
||||||
|
}
|
||||||
|
pthread_testcancel ();
|
||||||
|
if (WaitForSingleObject (signal_arrived, 10) == WAIT_OBJECT_0
|
||||||
|
&& !_my_tls.call_signal_handler ())
|
||||||
|
{
|
||||||
|
set_errno (EINTR);
|
||||||
|
rc = -1;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sleep (10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ReadFile (handle, outbuf, rlen, &n, NULL) == FALSE)
|
if (ReadFile (handle, outbuf, rlen, &n, NULL) == FALSE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user