Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Fix sigactsunshare() to do what the manpage and the...



details:   https://anonhg.NetBSD.org/src/rev/691a12d6470a
branches:  trunk
changeset: 769649:691a12d6470a
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Fri Sep 16 22:07:17 2011 +0000

description:
Fix sigactsunshare() to do what the manpage and the commit tells it to do!
I.e. unshare a process its sigacts by creating a new one BUT maintaining all
signal state.

The old code would CLEAR all the signal state. It used to work only due to the
fact that sigactunshare() is only used in execsigs() and the fact that
SIG_DFL was NULL.

diffstat:

 sys/kern/kern_sig.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 130bd6a0f854 -r 691a12d6470a sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Fri Sep 16 21:08:32 2011 +0000
+++ b/sys/kern/kern_sig.c       Fri Sep 16 22:07:17 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.315 2011/09/04 23:03:00 christos Exp $  */
+/*     $NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $   */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.315 2011/09/04 23:03:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.316 2011/09/16 22:07:17 reinoud Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_compat_sunos.h"
@@ -296,7 +296,7 @@
 
        ps = pool_cache_get(sigacts_cache, PR_WAITOK);
        mutex_init(&ps->sa_mutex, MUTEX_DEFAULT, IPL_SCHED);
-       memset(ps->sa_sigdesc, 0, sizeof(ps->sa_sigdesc));
+       memcpy(ps->sa_sigdesc, oldps->sa_sigdesc, sizeof(ps->sa_sigdesc));
        ps->sa_refcnt = 1;
 
        p->p_sigacts = ps;



Home | Main Index | Thread Index | Old Index