diff options
author | Christopher Faylor <me@cgf.cx> | 2010-08-10 16:44:37 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-08-10 16:44:37 +0000 |
commit | 92514fd261d8d45efe623f773cf14f9b5a3966c9 (patch) | |
tree | b11ceb582ffd04370d7dbe19cdab2c075c2040fc | |
parent | 514fdad34d5d3fcaec6334d78a01e5f8a4d225ad (diff) | |
download | cygnal-92514fd261d8d45efe623f773cf14f9b5a3966c9.tar.gz cygnal-92514fd261d8d45efe623f773cf14f9b5a3966c9.tar.bz2 cygnal-92514fd261d8d45efe623f773cf14f9b5a3966c9.zip |
* sigproc.cc (init_sig_pipe): Add retry loop.
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/sigproc.cc | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f9b385fb5..207f083fd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2010-08-10 Christopher Faylor <me+cygwin@cgf.cx> + + * sigproc.cc (init_sig_pipe): Add retry loop. + 2010-08-09 Christopher Faylor <me+cygwin@cgf.cx> * cygheap.h (cygheap_fdmanip): Delete fh and use fd index into diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index df797808e..a8bb4f340 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -1153,15 +1153,16 @@ pending_signals::next () /* Called separately to allow stack space reutilization by wait_sig. This function relies on the fact that it will be called after cygheap has been set up. For the case of non-dynamic DLL initialization this - means that it relies on the implicit serialization guarantted by being + means that it relies on the implicit serialization guaranteed by being run as part of DLL_PROCESS_ATTACH. */ static void __attribute__ ((noinline)) init_sig_pipe() { char char_sa_buf[1024]; PSECURITY_ATTRIBUTES sa_buf = sec_user_nih ((PSECURITY_ATTRIBUTES) char_sa_buf, cygheap->user.sid()); - if (!CreatePipe (&my_readsig, &my_sendsig, sa_buf, 0)) - api_fatal ("couldn't create signal pipe, %E"); + for (int i = 5; i > 0 && !CreatePipe (&my_readsig, &my_sendsig, sa_buf, 0); i--) + if (i == 1) + api_fatal ("couldn't create signal pipe, %E"); ProtectHandle (my_readsig); } |