Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-08-20 22:09:24 +0400
committerChristopher Faylor <me@cgf.cx>2003-08-20 22:09:24 +0400
commit2bf794af9a7fff8aeeae6e53642b64e40918b76f (patch)
tree8eaa50c94fc2303c4f6b595d496bab86fe058fcf /winsup/cygwin
parentd704b32411264ec79bbe0019649703f1709774f6 (diff)
* exceptions.cc (interrupt_setup): Set sigsave.sig last to avoid a race.
Diffstat (limited to 'winsup/cygwin')
-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 b4b12a15c..f3219d0b0 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 034e5605d..cff5719cf 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);
}