Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-10-15 21:12:17 +0400
committerChristopher Faylor <me@cgf.cx>2012-10-15 21:12:17 +0400
commit2c9cefa5868fce3417e19058a41a541a2baaf076 (patch)
treebdab3bd0bc49a21eb127cbdad8a09830df11654a /winsup/cygwin/fhandler_tty.cc
parentb0b441fcef3ed692bf67ebdaae0ab8f092ee8d02 (diff)
* fhandler_tty.cc (fhandler_pty_slave::write): Fix potential exit from loop
with write mutex held. Delete redundant mutex release. Clear tty error once we've grabbed it.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r--winsup/cygwin/fhandler_tty.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 954fd6622..6bb389f38 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -663,6 +663,8 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
{
set_errno (get_ttyp ()->write_error);
towrite = (DWORD) -1;
+ get_ttyp ()->write_error = 0;
+ release_output_mutex ();
break;
}
@@ -681,7 +683,6 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
}
raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */
towrite = (DWORD) -1;
- release_output_mutex ();
break;
}
}