Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern when undoing the sigsuspend setup, either take the ...



details:   https://anonhg.NetBSD.org/src/rev/7e9416d8e12b
branches:  trunk
changeset: 765531:7e9416d8e12b
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 29 22:14:53 2011 +0000

description:
when undoing the sigsuspend setup, either take the signal and allow the
signal path to restore the mask, or restore the mask here.

diffstat:

 sys/kern/sys_sig.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 4077780010b6 -r 7e9416d8e12b sys/kern/sys_sig.c
--- a/sys/kern/sys_sig.c        Sun May 29 22:12:32 2011 +0000
+++ b/sys/kern/sys_sig.c        Sun May 29 22:14:53 2011 +0000
@@ -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);
 }



Home | Main Index | Thread Index | Old Index