Module Name: src
Committed By: snj
Date: Wed Apr 1 21:56:51 UTC 2009
Modified Files:
src/sys/kern [netbsd-5]: kern_sig.c
Log Message:
Pull up following revision(s) (requested by drochner in ticket #640):
sys/kern/kern_sig.c: revision 1.296
In sigput(), save the siginfo no matter whether SA_SIGINFO is set or not.
There are also sigtimedwait(2) et al. to catch signals without invoking
a signal handler. Fixes PR kern/41076 by Matteo Beccati (the first
test case, where the signal is sent before sigwaitinfo(2) gets called).
To generate a diff of this commit:
cvs rdiff -u -r1.289.4.4 -r1.289.4.5 src/sys/kern/kern_sig.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.289.4.4 src/sys/kern/kern_sig.c:1.289.4.5
--- src/sys/kern/kern_sig.c:1.289.4.4 Tue Mar 31 23:41:23 2009
+++ src/sys/kern/kern_sig.c Wed Apr 1 21:56:50 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_sig.c,v 1.289.4.4 2009/03/31 23:41:23 snj Exp $ */
+/* $NetBSD: kern_sig.c,v 1.289.4.5 2009/04/01 21:56:50 snj Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.289.4.4 2009/03/31 23:41:23 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.289.4.5 2009/04/01 21:56:50 snj Exp $");
#include "opt_ptrace.h"
#include "opt_compat_sunos.h"
@@ -543,14 +543,12 @@
/*
* sigput:
*
- * Append a new ksiginfo element to the list of pending ksiginfo's, if
- * we need to (e.g. SA_SIGINFO was requested).
+ * Append a new ksiginfo element to the list of pending ksiginfo's.
*/
static void
sigput(sigpend_t *sp, struct proc *p, ksiginfo_t *ksi)
{
ksiginfo_t *kp;
- struct sigaction *sa = &SIGACTION_PS(p->p_sigacts, ksi->ksi_signo);
KASSERT(mutex_owned(p->p_lock));
KASSERT((ksi->ksi_flags & KSI_QUEUED) == 0);
@@ -558,11 +556,9 @@
sigaddset(&sp->sp_set, ksi->ksi_signo);
/*
- * If there is no siginfo, or is not required (and we don't add
- * it for the benefit of ktrace, we are done).
+ * If there is no siginfo, we are done.
*/
- if (KSI_EMPTY_P(ksi) ||
- (!KTRPOINT(p, KTR_PSIG) && (sa->sa_flags & SA_SIGINFO) == 0))
+ if (KSI_EMPTY_P(ksi))
return;
KASSERT((ksi->ksi_flags & KSI_FROMPOOL) != 0);