diff options
-rw-r--r-- | lib/libc_r/uthread/uthread_fork.c | 12 | ||||
-rw-r--r-- | lib/libkse/thread/thr_fork.c | 12 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_fork.c | 12 | ||||
-rw-r--r-- | sys/kern/kern_fork.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 1 |
5 files changed, 5 insertions, 34 deletions
diff --git a/lib/libc_r/uthread/uthread_fork.c b/lib/libc_r/uthread/uthread_fork.c index a2aabbe..4437d88 100644 --- a/lib/libc_r/uthread/uthread_fork.c +++ b/lib/libc_r/uthread/uthread_fork.c @@ -32,7 +32,6 @@ * $FreeBSD$ */ #include <errno.h> -#include <signal.h> #include <string.h> #include <stdlib.h> #include <unistd.h> @@ -113,16 +112,7 @@ _fork(void) else if (_pq_init(&_readyq) != 0) { /* Abort this application: */ PANIC("Cannot initialize priority ready queue."); - } else if ((_thread_sigstack.ss_sp == NULL) && - ((_thread_sigstack.ss_sp = malloc(SIGSTKSZ)) == NULL)) - PANIC("Unable to allocate alternate signal stack"); - else { - /* Install the alternate signal stack: */ - _thread_sigstack.ss_size = SIGSTKSZ; - _thread_sigstack.ss_flags = 0; - if (__sys_sigaltstack(&_thread_sigstack, NULL) != 0) - PANIC("Unable to install alternate signal stack"); - + } else { /* * Enter a loop to remove all threads other than * the running thread from the thread list: diff --git a/lib/libkse/thread/thr_fork.c b/lib/libkse/thread/thr_fork.c index a2aabbe..4437d88 100644 --- a/lib/libkse/thread/thr_fork.c +++ b/lib/libkse/thread/thr_fork.c @@ -32,7 +32,6 @@ * $FreeBSD$ */ #include <errno.h> -#include <signal.h> #include <string.h> #include <stdlib.h> #include <unistd.h> @@ -113,16 +112,7 @@ _fork(void) else if (_pq_init(&_readyq) != 0) { /* Abort this application: */ PANIC("Cannot initialize priority ready queue."); - } else if ((_thread_sigstack.ss_sp == NULL) && - ((_thread_sigstack.ss_sp = malloc(SIGSTKSZ)) == NULL)) - PANIC("Unable to allocate alternate signal stack"); - else { - /* Install the alternate signal stack: */ - _thread_sigstack.ss_size = SIGSTKSZ; - _thread_sigstack.ss_flags = 0; - if (__sys_sigaltstack(&_thread_sigstack, NULL) != 0) - PANIC("Unable to install alternate signal stack"); - + } else { /* * Enter a loop to remove all threads other than * the running thread from the thread list: diff --git a/lib/libpthread/thread/thr_fork.c b/lib/libpthread/thread/thr_fork.c index a2aabbe..4437d88 100644 --- a/lib/libpthread/thread/thr_fork.c +++ b/lib/libpthread/thread/thr_fork.c @@ -32,7 +32,6 @@ * $FreeBSD$ */ #include <errno.h> -#include <signal.h> #include <string.h> #include <stdlib.h> #include <unistd.h> @@ -113,16 +112,7 @@ _fork(void) else if (_pq_init(&_readyq) != 0) { /* Abort this application: */ PANIC("Cannot initialize priority ready queue."); - } else if ((_thread_sigstack.ss_sp == NULL) && - ((_thread_sigstack.ss_sp = malloc(SIGSTKSZ)) == NULL)) - PANIC("Unable to allocate alternate signal stack"); - else { - /* Install the alternate signal stack: */ - _thread_sigstack.ss_size = SIGSTKSZ; - _thread_sigstack.ss_flags = 0; - if (__sys_sigaltstack(&_thread_sigstack, NULL) != 0) - PANIC("Unable to install alternate signal stack"); - + } else { /* * Enter a loop to remove all threads other than * the running thread from the thread list: diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index c9539bb..d3b991d 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -495,7 +495,7 @@ again: * Preserve some more flags in subprocess. PS_PROFIL has already * been preserved. */ - p2->p_flag |= p1->p_flag & P_SUGID; + p2->p_flag |= p1->p_flag & (P_SUGID | P_ALTSTACK); if (p1->p_session->s_ttyvp != NULL && p1->p_flag & P_CONTROLT) p2->p_flag |= P_CONTROLT; if (flags & RFPPWAIT) diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c57074a..55da023 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -464,6 +464,7 @@ execsigs(p) p->p_sigstk.ss_flags = SS_DISABLE; p->p_sigstk.ss_size = 0; p->p_sigstk.ss_sp = 0; + p->p_flag &= ~P_ALTSTACK; /* * Reset no zombies if child dies flag as Solaris does. */ |