diff options
author | Christopher Faylor <me@cgf.cx> | 2013-12-18 03:01:39 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-12-18 03:01:39 +0000 |
commit | 1147c2111d9d02133c7192b900ae7d0c74d2622c (patch) | |
tree | fb44ff2b4e298133269a13a0e7e73d4e8ee7bbaf /winsup | |
parent | 891b1e7e22ff6a20040c81b0e21bfe977cbee445 (diff) | |
download | cygnal-1147c2111d9d02133c7192b900ae7d0c74d2622c.tar.gz cygnal-1147c2111d9d02133c7192b900ae7d0c74d2622c.tar.bz2 cygnal-1147c2111d9d02133c7192b900ae7d0c74d2622c.zip |
* sigproc.cc (sig_send): Set PIPE_NOWAIT for pipes which are not us.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.cc | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 618b8d88e..79b4e3cba 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,9 @@ 2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + * sigproc.cc (sig_send): Set PIPE_NOWAIT for pipes which are not us. + +2013-12-17 Christopher Faylor <me.cygwin2013@cgf.cx> + * fhandler.h (fhandler_pty_master::~fhandler_pty_master): Delete. * fhandler_tty.cc (fhandler_pty_master::~fhandler_pty_master): Ditto. diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 906dc6a35..c65e7bb37 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -553,7 +553,16 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls) } VerifyHandle (sendsig); if (!communing) - CloseHandle (hp); + { + CloseHandle (hp); + DWORD flag = PIPE_NOWAIT; + /* Set PIPE_NOWAIT here to avoid blocking when sending a signal. + (Yes, I know MSDN says not to use this) + We can't ever block here because it causes a deadlock when + debugging with gdb. */ + BOOL res = SetNamedPipeHandleState (sendsig, &flag, NULL, NULL); + sigproc_printf ("%d = SetNamedPipeHandleState (%y, PIPE_NOWAIT, NULL, NULL)", res, sendsig); + } else { si._si_commune._si_process_handle = hp; |