Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/kern/sys_sig.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/kern/sys_sig.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.26 retrieving revision 1.26.2.2 diff -u -p -r1.26 -r1.26.2.2 --- src/sys/kern/sys_sig.c 2010/01/19 22:28:31 1.26 +++ src/sys/kern/sys_sig.c 2010/10/22 07:22:29 1.26.2.2 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_sig.c,v 1.26 2010/01/19 22:28:31 pooka Exp $ */ +/* $NetBSD: sys_sig.c,v 1.26.2.2 2010/10/22 07:22:29 uebayasi Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.26 2010/01/19 22:28:31 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.26.2.2 2010/10/22 07:22:29 uebayasi Exp $"); #include #include @@ -235,7 +235,8 @@ sys_kill(struct lwp *l, const struct sys if (SCARG(uap, pid) > 0) { /* kill single process */ mutex_enter(proc_lock); - if ((p = p_find(SCARG(uap, pid), PFIND_LOCKED)) == NULL) { + p = proc_find(SCARG(uap, pid)); + if (p == NULL) { mutex_exit(proc_lock); return ESRCH; } @@ -346,13 +347,13 @@ sigaction1(struct lwp *l, int signum, co * * If version < 2, we try to autoload the compat module. Note * that we interlock with the unload check in compat_modcmd() - * using module_lock. If the autoload fails, we don't try it + * using kernconfig_lock. If the autoload fails, we don't try it * again for this process. */ if (nsa != NULL) { if (__predict_false(vers < 2) && (p->p_lflag & PL_SIGCOMPAT) == 0) { - mutex_enter(&module_lock); + kernconfig_lock(); if (sendsig_sigcontext_vec == NULL) { (void)module_autoload("compat", MODULE_CLASS_ANY); @@ -373,7 +374,7 @@ sigaction1(struct lwp *l, int signum, co */ p->p_lflag |= PL_SIGCOMPAT; mutex_exit(proc_lock); - mutex_exit(&module_lock); + kernconfig_unlock(); } switch (vers) { @@ -742,9 +743,11 @@ out: * Copy only the used part of siginfo, the padding part is * left unchanged (userland is not supposed to touch it anyway). */ - if (error == 0) { + if (error == 0 && SCARG(uap, info)) { error = (*storeinf)(&ksi.ksi_info, SCARG(uap, info), sizeof(ksi.ksi_info)); } + if (error == 0) + *retval = ksi.ksi_info._signo; return error; }