summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_tty.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-02-25 16:46:57 +0000
committerCorinna Vinschen <corinna@vinschen.de>2015-02-25 16:46:57 +0000
commit9d5309bf8911fbfee2270132da8446e81527f2fb (patch)
tree9f336e79e31f1272bc3c73d695f5cb7c6e4940d2 /winsup/cygwin/fhandler_tty.cc
parent67d150ca141181c55957c594346691ae8f9f5c3f (diff)
downloadcygnal-9d5309bf8911fbfee2270132da8446e81527f2fb.tar.gz
cygnal-9d5309bf8911fbfee2270132da8446e81527f2fb.tar.bz2
cygnal-9d5309bf8911fbfee2270132da8446e81527f2fb.zip
* fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not an
error condition for tcflush.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 25076810e..9d793281a 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -1,7 +1,7 @@
/* fhandler_tty.cc
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
- 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
+ 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Red Hat, Inc.
This file is part of Cygwin.
@@ -755,7 +755,8 @@ fhandler_pty_slave::read (void *ptr, size_t& len)
/*NOTREACHED*/
case WAIT_TIMEOUT:
termios_printf ("wait timed out, time_to_wait %u", time_to_wait);
- if (!totalread)
+ /* No error condition when called from tcflush. */
+ if (!totalread && ptr)
{
set_sig_errno (EAGAIN);
totalread = -1;