Module Name: src
Committed By: christos
Date: Thu Nov 8 17:40:46 UTC 2012
Modified Files:
src/sys/kern: kern_exec.c
Log Message:
If you are going to dick around with p_stat, remember to put it
back so that spawn processes with attributes don't end up starting
up stopped!
XXX: pullup to 6.
To generate a diff of this commit:
cvs rdiff -u -r1.357 -r1.358 src/sys/kern/kern_exec.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/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.357 src/sys/kern/kern_exec.c:1.358
--- src/sys/kern/kern_exec.c:1.357 Sun Oct 14 16:56:55 2012
+++ src/sys/kern/kern_exec.c Thu Nov 8 12:40:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_exec.c,v 1.357 2012/10/14 20:56:55 christos Exp $ */
+/* $NetBSD: kern_exec.c,v 1.358 2012/11/08 17:40:46 christos Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.357 2012/10/14 20:56:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.358 2012/11/08 17:40:46 christos Exp $");
#include "opt_exec.h"
#include "opt_ktrace.h"
@@ -1897,6 +1897,7 @@ spawn_return(void *arg)
/* handle posix_spawnattr */
if (spawn_data->sed_attrs != NULL) {
+ int ostat;
struct sigaction sigact;
sigact._sa_u._sa_handler = SIG_DFL;
sigact.sa_flags = 0;
@@ -1905,6 +1906,7 @@ spawn_return(void *arg)
* set state to SSTOP so that this proc can be found by pid.
* see proc_enterprp, do_sched_setparam below
*/
+ ostat = l->l_proc->p_stat;
l->l_proc->p_stat = SSTOP;
/* Set process group */
@@ -1966,6 +1968,7 @@ spawn_return(void *arg)
0);
}
}
+ l->l_proc->p_stat = ostat;
}
/* now do the real exec */