diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-09-12 21:33:22 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-09-12 21:33:22 +0000 |
commit | b39c6f8b7a847270f8b0a0c9f101535cce29d00e (patch) | |
tree | 32774357959d3cd9b0f93708f9c2b7598c80885e /sysdeps | |
parent | c06cc21c043b02d0d7c078730695be370c66571c (diff) | |
download | glibc-b39c6f8b7a847270f8b0a0c9f101535cce29d00e.tar.gz glibc-b39c6f8b7a847270f8b0a0c9f101535cce29d00e.tar.xz glibc-b39c6f8b7a847270f8b0a0c9f101535cce29d00e.zip |
Update.
1998-09-12 Mark Kettenis <kettenis@phys.uva.nl> * sysdeps/generic/segfault.c (install_handler): Install signal handler with SA_ONSTACK instead of setting the stack flags to SS_ONSTACK. Do not install handler for SIGSTKFLT if it is not defined. 1998-09-12 14:24 -0400 Zack Weinberg <zack@rabi.phys.columbia.edu> * signal/signal.h: Fix multiple inclusion guard to cover the entire file. * wcsmbs/wchar.h: Remove prototype of internal function __mbsrtowcs. * sysdeps/i386/i486/bits/string.h (memchr): Don't do arithmetic on `void *'.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/segfault.c | 33 | ||||
-rw-r--r-- | sysdeps/i386/i486/bits/string.h | 2 |
2 files changed, 18 insertions, 17 deletions
diff --git a/sysdeps/generic/segfault.c b/sysdeps/generic/segfault.c index 5a9e64a105..b0778df6fc 100644 --- a/sysdeps/generic/segfault.c +++ b/sysdeps/generic/segfault.c @@ -163,6 +163,23 @@ install_handler (void) sigemptyset (&sa.sa_mask); sa.sa_flags = SA_RESTART; + /* Maybe we are expected to use an alternative stack. */ + if (getenv ("SEGFAULT_USE_ALTSTACK") != 0) + { + void *stack_mem = malloc (2 * SIGSTKSZ); + struct sigaltstack ss; + + if (stack_mem != NULL) + { + ss.ss_sp = stack_mem; + ss.ss_flags = 0; + ss.ss_size = 2 * SIGSTKSZ; + + if (sigaltstack (&ss, NULL) == 0) + sa.sa_flags |= SA_ONSTACK; + } + } + if (sigs == NULL) sigaction (SIGSEGV, &sa, NULL); else if (sigs[0] == '\0') @@ -191,20 +208,4 @@ install_handler (void) INSTALL_FOR_SIG (SIGABRT, "abrt"); INSTALL_FOR_SIG (SIGFPE, "fpe"); } - - /* Maybe we are expected to use an alternative stack. */ - if (getenv ("SEGFAULT_USE_ALTSTACK") != 0) - { - void *stack_mem = malloc (2 * SIGSTKSZ); - struct sigaltstack ss; - - if (stack_mem != NULL) - { - ss.ss_sp = stack_mem; - ss.ss_flags = SS_ONSTACK; - ss.ss_size = 2 * SIGSTKSZ; - - sigaltstack (&ss, NULL); - } - } } diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h index 921c66498e..134f117377 100644 --- a/sysdeps/i386/i486/bits/string.h +++ b/sysdeps/i386/i486/bits/string.h @@ -329,7 +329,7 @@ __STRING_INLINE void * memchr (__const void *__s, int __c, size_t __n) { register unsigned long int __d0; - register void *__res; + register unsigned char *__res; if (__n == 0) return NULL; #ifdef __i686__ |