Module Name: src Committed By: christos Date: Sun May 29 22:14:53 UTC 2011
Modified Files: src/sys/kern: sys_sig.c Log Message: when undoing the sigsuspend setup, either take the signal and allow the signal path to restore the mask, or restore the mask here. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/kern/sys_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/sys_sig.c diff -u src/sys/kern/sys_sig.c:1.34 src/sys/kern/sys_sig.c:1.35 --- src/sys/kern/sys_sig.c:1.34 Sat May 28 11:33:40 2011 +++ src/sys/kern/sys_sig.c Sun May 29 18:14:53 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_sig.c,v 1.34 2011/05/28 15:33:40 christos Exp $ */ +/* $NetBSD: sys_sig.c,v 1.35 2011/05/29 22:14:53 christos Exp $ */ /*- * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.34 2011/05/28 15:33:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_sig.c,v 1.35 2011/05/29 22:14:53 christos Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -637,9 +637,16 @@ struct proc *p = l->l_proc; mutex_enter(p->p_lock); + /* Check for pending signals when sleeping. */ if (l->l_sigrestore) { - l->l_sigrestore = 0; - l->l_sigmask = l->l_sigoldmask; + if (sigispending(l, 0)) { + lwp_lock(l); + l->l_flag |= LW_PENDSIG; + lwp_unlock(l); + } else { + l->l_sigrestore = 0; + l->l_sigmask = l->l_sigoldmask; + } } mutex_exit(p->p_lock); }