From 9d5309bf8911fbfee2270132da8446e81527f2fb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 25 Feb 2015 16:46:57 +0000 Subject: [PATCH] * fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not an error condition for tcflush. --- winsup/cygwin/ChangeLog | 12 ++++++++++++ winsup/cygwin/fhandler_tty.cc | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d50351f8b..8c80f97e3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,15 @@ +2015-02-25 Corinna Vinschen + + * fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not an + error condition for tcflush. + +2015-02-25 Corinna Vinschen + + * fhandler_tape.cc (fhandler_dev_tape::_lock): Add cw_sig_restart to + cygwait call. + * thread.cc (pthread_mutex::lock): Ditto. + * thread.h (fast_mutex::lock): Ditto. + 2015-02-25 Corinna Vinschen * security.cc (alloc_sd): Fix comment style. Remove code unused for 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;