Add comment to sigaltstack to explain setting ss_flags here

* signal.cc (sigaltstack): Add comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2015-06-30 20:43:50 +02:00
parent 166d86c9d4
commit 0f3e631571
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2015-06-30 Corinna Vinschen <corinna@vinschen.de>
* signal.cc (sigaltstack): Add comment.
2015-06-27 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (_cygtls::call_signal_handler): Drop manipulating

View File

@ -670,6 +670,10 @@ sigaltstack (const stack_t *ss, stack_t *oss)
{
char stack_marker;
memcpy (oss, &me.altstack, sizeof *oss);
/* Check if the current stack is the alternate signal stack. If so,
set ss_flags accordingly. We do this here rather than setting
ss_flags in _cygtls::call_signal_handler since the signal handler
calls longjmp, so we never return to reset the flag. */
if (!me.altstack.ss_flags && me.altstack.ss_sp)
{
if (&stack_marker >= (char *) me.altstack.ss_sp