aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-08-20 18:09:24 +0000
committerChristopher Faylor <me@cgf.cx>2003-08-20 18:09:24 +0000
commit2bf794af9a7fff8aeeae6e53642b64e40918b76f (patch)
tree8eaa50c94fc2303c4f6b595d496bab86fe058fcf /winsup
parentd704b32411264ec79bbe0019649703f1709774f6 (diff)
downloadnewlib-2bf794af9a7fff8aeeae6e53642b64e40918b76f.zip
newlib-2bf794af9a7fff8aeeae6e53642b64e40918b76f.tar.gz
newlib-2bf794af9a7fff8aeeae6e53642b64e40918b76f.tar.bz2
* exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a race.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/exceptions.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b4b12a1..f3219d0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-20 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a
+ race.
+
2003-08-20 Christopher Faylor <cgf@redhat.com>
* sigproc.cc (wait_sig): Ensure that myself->getsigtodo array is
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 034e560..cff5719 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -693,7 +693,6 @@ interrupt_setup (int sig, void *handler, DWORD retaddr, DWORD *retaddr_on_stack,
sigsave.newmask = sigsave.oldmask | siga.sa_mask | SIGTOMASK (sig);
sigsave.sa_flags = siga.sa_flags;
sigsave.func = (void (*)(int)) handler;
- sigsave.sig = sig;
sigsave.saved_errno = -1; // Flag: no errno to save
if (handler == sig_handle_tty_stop)
{
@@ -703,6 +702,7 @@ interrupt_setup (int sig, void *handler, DWORD retaddr, DWORD *retaddr_on_stack,
/* Clear any waiting threads prior to dispatching to handler function */
proc_subproc (PROC_CLEARWAIT, 1);
int res = SetEvent (signal_arrived); // For an EINTR case
+ sigsave.sig = sig; // Should ALWAYS be last thing set to avoid a race
sigproc_printf ("armed signal_arrived %p, res %d", signal_arrived, res);
}