Module Name: src
Committed By: christos
Date: Wed Apr 27 21:15:40 UTC 2016
Modified Files:
src/sys/kern: kern_exit.c kern_sig.c
src/sys/sys: proc.h
Log Message:
We need a flag for WCONTINUED so that we can reset it... Fixes bash issue.
To generate a diff of this commit:
cvs rdiff -u -r1.257 -r1.258 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.325 -r1.326 src/sys/kern/kern_sig.c
cvs rdiff -u -r1.329 -r1.330 src/sys/sys/proc.h
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/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.257 src/sys/kern/kern_exit.c:1.258
--- src/sys/kern/kern_exit.c:1.257 Mon Apr 25 12:35:47 2016
+++ src/sys/kern/kern_exit.c Wed Apr 27 17:15:40 2016
@@ -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 @@ find_stopped_child(struct proc *parent,
}
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--;
}
Index: src/sys/kern/kern_sig.c
diff -u src/sys/kern/kern_sig.c:1.325 src/sys/kern/kern_sig.c:1.326
--- src/sys/kern/kern_sig.c:1.325 Tue Apr 5 23:11:31 2016
+++ src/sys/kern/kern_sig.c Wed Apr 27 17:15:40 2016
@@ -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 @@ kpsignal2(struct proc *p, ksiginfo_t *ks
*/
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 @@ issignal(struct lwp *l)
/* 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) {
Index: src/sys/sys/proc.h
diff -u src/sys/sys/proc.h:1.329 src/sys/sys/proc.h:1.330
--- src/sys/sys/proc.h:1.329 Mon Apr 4 19:07:06 2016
+++ src/sys/sys/proc.h Wed Apr 27 17:15:40 2016
@@ -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 @@ struct proc {
#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 */
/*