aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2022-05-05 21:12:26 +0900
committerTakashi Yano <takashi.yano@nifty.ne.jp>2022-05-05 21:35:04 +0900
commitaa9b5262f238d446260ec06d962f4c325a64dd89 (patch)
tree3c02378bc1f2fc22c0949315e85de6f1f1d643f8 /winsup
parent323b61f27119702dd07760ab36dab7ff690b563a (diff)
downloadnewlib-aa9b5262f238d446260ec06d962f4c325a64dd89.zip
newlib-aa9b5262f238d446260ec06d962f4c325a64dd89.tar.gz
newlib-aa9b5262f238d446260ec06d962f4c325a64dd89.tar.bz2
Cygwin: sigproc: Avoid segfault caused by signal just after fork().
- The commit "Cygwin: always add sigmask to child info" also tries to fix this issue, however, did not fix enough. This patch fixes that.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/sigproc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 987dfea..a70c3b6 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -1356,9 +1356,9 @@ wait_sig (VOID *)
when _main_tls points to the system-allocated stack, not to
the parent thread. In that case find_tls fails, and we fetch
the sigmask from the child_info passed from the parent. */
- tl_entry = cygheap->find_tls (_main_tls);
- if (tl_entry)
+ if (cygwin_finished_initializing)
{
+ tl_entry = cygheap->find_tls (_main_tls);
dummy_mask = _main_tls->sigmask;
cygheap->unlock_tls (tl_entry);
}