* 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.
This commit is contained in:
Christopher Faylor 2012-10-15 17:12:17 +00:00
parent b0b441fcef
commit 2c9cefa586
3 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-10-15 Christopher Faylor <me.cygwin2012@cgf.cx>
* 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.
2012-10-15 Corinna Vinschen <corinna@vinschen.de>
* fhandler_raw.cc (fhandler_dev_raw::fhandler_dev_raw): Drop gratuitous

View File

@ -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;
}
}

View File

@ -1,6 +1,9 @@
Bug fixes:
----------
- Prevent CTRL-S hang.
Fixes: http://cygwin.com/ml/cygwin/2012-10/threads.html#00089
- Revamp signals so that signals-to-threads more closely mimic Linux
operation.
First step of fix for: http://cygwin.com/ml/cygwin/2012-05/msg00186.html