* fhandler_tty.cc (fhandler_pty_slave::read): Use consistent way for testing

ReadFile return.
* pipe.cc (fhandler_pipe::create_selectable): Open the write side of the pipe
in message-mode to force writing as "chunks".  Explain why.
This commit is contained in:
Christopher Faylor
2011-10-23 19:01:47 +00:00
parent 1f012519e4
commit 31d2bedc58
3 changed files with 16 additions and 3 deletions

View File

@@ -812,7 +812,7 @@ fhandler_pty_slave::read (void *ptr, size_t& len)
if (readlen)
{
termios_printf ("reading %d bytes (vtime %d)", readlen, vtime);
if (ReadFile (get_handle (), buf, readlen, &n, NULL) == FALSE)
if (!ReadFile (get_handle (), buf, readlen, &n, NULL))
{
termios_printf ("read failed, %E");
raise (SIGHUP);