summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-04-18 08:25:05 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-04-18 08:25:05 +0000
commit20ee1322a1e4d34926d2e2bcb288ecfac8a06b22 (patch)
tree048874e17c4f9b007ecc962ddc4970acdce512e3 /sys/kern
parente3b66af4a7517f7687ef514cf6b44c81f1e2a578 (diff)
Provide the correct signal number to the ktrace PSIG information instead
of an uninitialized variable. millert@ ok
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index c1511bab3e7..aa456f3cbc4 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.56 2002/03/14 01:27:04 millert Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.57 2002/04/18 08:25:04 miod Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -1154,6 +1154,13 @@ postsig(signum)
mask = sigmask(signum);
p->p_siglist &= ~mask;
action = ps->ps_sigact[signum];
+
+ if (ps->ps_sig != signum) {
+ code = 0;
+ } else {
+ code = ps->ps_code;
+ }
+
#ifdef KTRACE
if (KTRPOINT(p, KTR_PSIG)) {
siginfo_t si;
@@ -1203,10 +1210,7 @@ postsig(signum)
}
splx(s);
p->p_stats->p_ru.ru_nsignals++;
- if (ps->ps_sig != signum) {
- code = 0;
- } else {
- code = ps->ps_code;
+ if (ps->ps_sig == signum) {
ps->ps_code = 0;
}
null_sigval.sival_ptr = 0;