Source-Changes-HG archive

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

[src/trunk]: src/sys We need a flag for WCONTINUED so that we can reset it......



details:   https://anonhg.NetBSD.org/src/rev/de67ac40c2d6
branches:  trunk
changeset: 815065:de67ac40c2d6
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Apr 27 21:15:40 2016 +0000

description:
We need a flag for WCONTINUED so that we can reset it... Fixes bash issue.

diffstat:

 sys/kern/kern_exit.c |  8 +++++---
 sys/kern/kern_sig.c  |  7 +++++--
 sys/sys/proc.h       |  3 ++-
 3 files changed, 12 insertions(+), 6 deletions(-)

diffs (82 lines):

diff -r 83205d35ce73 -r de67ac40c2d6 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Wed Apr 27 21:14:24 2016 +0000
+++ b/sys/kern/kern_exit.c      Wed Apr 27 21:15:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.257 2016/04/25 16:35:47 christos Exp $ */
+/*     $NetBSD: kern_exit.c,v 1.258 2016/04/27 21:15:40 christos Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.257 2016/04/25 16:35:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.258 2016/04/27 21:15:40 christos Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -1011,8 +1011,10 @@
                        }
 
                        if ((options & WCONTINUED) != 0 &&
-                           child->p_xsig == SIGCONT) {
+                           child->p_xsig == SIGCONT &&
+                           (child->p_sflag & PS_CONTINUED)) {
                                if ((options & WNOWAIT) == 0) {
+                                       child->p_sflag &= ~PS_CONTINUED;
                                        child->p_waited = 1;
                                        parent->p_nstopchild--;
                                }
diff -r 83205d35ce73 -r de67ac40c2d6 sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c       Wed Apr 27 21:14:24 2016 +0000
+++ b/sys/kern/kern_sig.c       Wed Apr 27 21:15:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sig.c,v 1.325 2016/04/06 03:11:31 christos Exp $  */
+/*     $NetBSD: kern_sig.c,v 1.326 2016/04/27 21:15:40 christos 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.325 2016/04/06 03:11:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.326 2016/04/27 21:15:40 christos Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_dtrace.h"
@@ -1382,6 +1382,7 @@
                         */
                        if ((prop & SA_CONT) != 0) {
                                p->p_xsig = SIGCONT;
+                               p->p_sflag |= PS_CONTINUED;
                                child_psignal(p, 0);
                                if (action == SIG_DFL) {
                                        KASSERT(signo != SIGKILL);
@@ -1750,6 +1751,8 @@
                                /* Take the signal. */
                                (void)sigget(sp, NULL, signo, NULL);
                                p->p_xsig = signo;
+                               if (p->p_sflag & PS_CONTINUED)
+                                       p->p_sflag &= ~PS_CONTINUED;
                                signo = 0;
                                sigswitch(true, PS_NOCLDSTOP, p->p_xsig);
                        } else if (prop & SA_IGNORE) {
diff -r 83205d35ce73 -r de67ac40c2d6 sys/sys/proc.h
--- a/sys/sys/proc.h    Wed Apr 27 21:14:24 2016 +0000
+++ b/sys/sys/proc.h    Wed Apr 27 21:15:40 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.329 2016/04/04 23:07:06 christos Exp $      */
+/*     $NetBSD: proc.h,v 1.330 2016/04/27 21:15:40 christos Exp $      */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -384,6 +384,7 @@
 #define        PS_STOPEXIT     0x02000000 /* Will be stopped at process exit */
 #define        PS_NOTIFYSTOP   0x10000000 /* Notify parent of successful STOP */
 #define        PS_COREDUMP     0x20000000 /* Process core-dumped */
+#define        PS_CONTINUED    0x40000000 /* Process is continued */
 #define        PS_STOPPING     0x80000000 /* Transitioning SACTIVE -> SSTOP */
 
 /*



Home | Main Index | Thread Index | Old Index