add a macro to copy ksiginfo_t, and use it in kern_sig.c:ksiginfo_put()

change suggested by Christian Limpach
This commit is contained in:
jdolecek 2003-11-01 17:59:57 +00:00
parent 518c5a2e6a
commit 8f8952e2b1
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sig.c,v 1.173 2003/11/01 07:44:14 jdolecek Exp $ */
/* $NetBSD: kern_sig.c,v 1.174 2003/11/01 17:59:57 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.173 2003/11/01 07:44:14 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.174 2003/11/01 17:59:57 jdolecek Exp $");
#include "opt_ktrace.h"
#include "opt_compat_sunos.h"
@ -154,8 +154,7 @@ ksiginfo_put(struct proc *p, const ksiginfo_t *ksi)
{
CIRCLEQ_FOREACH(kp, &p->p_sigctx.ps_siginfo, ksi_list) {
if (kp->ksi_signo == ksi->ksi_signo) {
kp->ksi_info = ksi->ksi_info;
kp->ksi_flags = ksi->ksi_flags;
KSI_COPY(ksi, kp);
goto out;
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: siginfo.h,v 1.8 2003/10/13 18:50:43 fvdl Exp $ */
/* $NetBSD: siginfo.h,v 1.9 2003/11/01 17:59:57 jdolecek Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -107,6 +107,13 @@ do { \
(ksi)->ksi_flags |= KSI_TRAP; \
} while (/*CONSTCOND*/0)
/* Copy the part of ksiginfo_t without the queue pointers */
#define KSI_COPY(fksi, tksi) \
do { \
tksi->ksi_info = fksi->ksi_info; \
tksi->ksi_flags = fksi->ksi_flags; \
} while (/*CONSTCOND*/0)
/*
* Old-style signal handler "code" arguments were only non-zero for
* signals caused by traps.