Move code block added in 1.157 to a safer part of fork1().

Submitted by:	 jake
This commit is contained in:
Matthew N. Dodd 2002-08-07 11:31:45 +00:00
parent dfb18183be
commit df95311a10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101457

View File

@ -641,6 +641,15 @@ fork1(td, flags, procp)
mtx_unlock(&ktrace_mtx);
#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..
@ -758,15 +767,6 @@ fork1(td, flags, procp)
msleep(p1, &p2->p_mtx, PWAIT, "ppwait", 0);
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.
*/