Cygwin: follow context if changed inside SA_SIGINFO signal handler
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
c5f9eed1c0
commit
181ca73e49
@ -1645,7 +1645,7 @@ _cygtls::call_signal_handler ()
|
|||||||
siginfo_t thissi = infodata;
|
siginfo_t thissi = infodata;
|
||||||
void (*thisfunc) (int, siginfo_t *, void *) = func;
|
void (*thisfunc) (int, siginfo_t *, void *) = func;
|
||||||
|
|
||||||
ucontext_t *thiscontext = NULL;
|
ucontext_t *thiscontext = NULL, context_copy;
|
||||||
|
|
||||||
/* Only make a context for SA_SIGINFO handlers */
|
/* Only make a context for SA_SIGINFO handlers */
|
||||||
if (this_sa_flags & SA_SIGINFO)
|
if (this_sa_flags & SA_SIGINFO)
|
||||||
@ -1701,6 +1701,7 @@ _cygtls::call_signal_handler ()
|
|||||||
? (uintptr_t) thissi.si_addr : 0;
|
? (uintptr_t) thissi.si_addr : 0;
|
||||||
|
|
||||||
thiscontext = &context;
|
thiscontext = &context;
|
||||||
|
context_copy = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
int this_errno = saved_errno;
|
int this_errno = saved_errno;
|
||||||
@ -1822,6 +1823,14 @@ _cygtls::call_signal_handler ()
|
|||||||
? context.uc_sigmask : this_oldmask);
|
? context.uc_sigmask : this_oldmask);
|
||||||
if (this_errno >= 0)
|
if (this_errno >= 0)
|
||||||
set_errno (this_errno);
|
set_errno (this_errno);
|
||||||
|
if (this_sa_flags & SA_SIGINFO)
|
||||||
|
{
|
||||||
|
/* If more than just the sigmask in the context has been changed by
|
||||||
|
the signal handler, call setcontext. */
|
||||||
|
context_copy.uc_sigmask = context.uc_sigmask;
|
||||||
|
if (memcmp (&context, &context_copy, sizeof context) != 0)
|
||||||
|
setcontext (&context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: Since 2011 this return statement always returned 1 (meaning
|
/* FIXME: Since 2011 this return statement always returned 1 (meaning
|
||||||
|
Loading…
x
Reference in New Issue
Block a user