summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2002-08-07 11:31:45 +0000
committermdodd <mdodd@FreeBSD.org>2002-08-07 11:31:45 +0000
commit81d5cd61a70464b2894854ca5ddb735a8298d415 (patch)
tree5a1c2cab20b186d2143616847ece099a49312156 /sys/kern/kern_fork.c
parentfcb62c09162751be49f74a1d485c23b322a71f1d (diff)
downloadFreeBSD-src-81d5cd61a70464b2894854ca5ddb735a8298d415.zip
FreeBSD-src-81d5cd61a70464b2894854ca5ddb735a8298d415.tar.gz
Move code block added in 1.157 to a safer part of fork1().
Submitted by: jake
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index bf8f6fb..e09e98d 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -642,6 +642,15 @@ again:
#endif
/*
+ * If PF_FORK is set, the child process inherits the
+ * procfs ioctl flags from its parent.
+ */
+ if (p1->p_pfsflags & PF_FORK) {
+ p2->p_stops = p1->p_stops;
+ p2->p_pfsflags = p1->p_pfsflags;
+ }
+
+ /*
* set priority of child to be that of parent
* XXXKSE hey! copying the estcpu seems dodgy.. should split it..
*/
@@ -759,15 +768,6 @@ again:
PROC_UNLOCK(p2);
/*
- * If PF_FORK is set, the child process inherits the
- * procfs ioctl flags from its parent.
- */
- if (p1->p_pfsflags & PF_FORK) {
- p2->p_stops = p1->p_stops;
- p2->p_pfsflags = p1->p_pfsflags;
- }
-
- /*
* Return child proc pointer to parent.
*/
*procp = p2;
OpenPOWER on IntegriCloud