diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-04-19 05:04:06 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-04-19 05:04:06 +0000 |
commit | 28038e92fe77191c84ef5fab7180756d4f32de26 (patch) | |
tree | 33b11e086942e2aebdf59db72bef35e17cac2b77 /sys/kern | |
parent | 8ef415ed061dc2a2a957c2f56a03b665be5d6a11 (diff) | |
download | FreeBSD-src-28038e92fe77191c84ef5fab7180756d4f32de26.zip FreeBSD-src-28038e92fe77191c84ef5fab7180756d4f32de26.tar.gz |
Unbreak sigaltstack syscall. sigonstack is now a function and
want proc lock be held.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sig.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index e6a6e17..d204949 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1228,15 +1228,13 @@ kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss) int error = 0; mtx_lock(&Giant); - + PROC_LOCK(p); oonstack = sigonstack(cpu_getstack(td)); if (oss != NULL) { - PROC_LOCK(p); *oss = p->p_sigstk; oss->ss_flags = (p->p_flag & P_ALTSTACK) ? ((oonstack) ? SS_ONSTACK : 0) : SS_DISABLE; - PROC_UNLOCK(p); } if (ss != NULL) { @@ -1253,17 +1251,14 @@ kern_sigaltstack(struct thread *td, stack_t *ss, stack_t *oss) error = ENOMEM; goto done2; } - PROC_LOCK(p); p->p_sigstk = *ss; p->p_flag |= P_ALTSTACK; - PROC_UNLOCK(p); } else { - PROC_LOCK(p); p->p_flag &= ~P_ALTSTACK; - PROC_UNLOCK(p); } } done2: + PROC_UNLOCK(p); mtx_unlock(&Giant); return (error); } |