summaryrefslogtreecommitdiff
path: root/lib/c-stack.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-01-24 14:05:48 +0100
committerBruno Haible <bruno@clisp.org>2009-01-24 14:05:48 +0100
commit10ab13e5406be8ab69a80e3ae0286a80481b9ec2 (patch)
tree8a4dd76d5079efc5692dd15261da75e9af464b4f /lib/c-stack.c
parent151fa2d3905c0d3427303d65d424f7312e95eb30 (diff)
downloadgnulib-10ab13e5406be8ab69a80e3ae0286a80481b9ec2.tar.gz
On HP-UX, don't pretend it was a SIGSEGV when it was a stack overflow.
Diffstat (limited to 'lib/c-stack.c')
-rw-r--r--lib/c-stack.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/c-stack.c b/lib/c-stack.c
index e5e3ab610d..d260b47aa5 100644
--- a/lib/c-stack.c
+++ b/lib/c-stack.c
@@ -239,21 +239,21 @@ segv_handler (int signo, siginfo_t *info,
void *context __attribute__ ((unused)))
{
/* Clear SIGNO if it seems to have been a stack overflow. */
- if (0 < info->si_code)
- {
# if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC
- /* We can't easily determine whether it is a stack overflow; so
- assume that the rest of our program is perfect (!) and that
- this segmentation violation is a stack overflow.
-
- Note that although both Linux and Solaris provide
- sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only
- Solaris satisfies the XSI heueristic. This is because
- Solaris populates uc_stack with the details of the
- interrupted stack, while Linux populates it with the details
- of the current stack. */
- signo = 0;
+ /* We can't easily determine whether it is a stack overflow; so
+ assume that the rest of our program is perfect (!) and that
+ this segmentation violation is a stack overflow.
+
+ Note that although both Linux and Solaris provide
+ sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only
+ Solaris satisfies the XSI heueristic. This is because
+ Solaris populates uc_stack with the details of the
+ interrupted stack, while Linux populates it with the details
+ of the current stack. */
+ signo = 0;
# else
+ if (0 < info->si_code)
+ {
/* If the faulting address is within the stack, or within one
page of the stack end, assume that it is a stack
overflow. */
@@ -278,8 +278,8 @@ segv_handler (int signo, siginfo_t *info,
write (STDERR_FILENO, buf, strlen (buf));
}
# endif
-# endif
}
+# endif
die (signo);
}