summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc/mgt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/proc/mgt.c b/proc/mgt.c
index 250cfae0..b914c761 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -172,9 +172,12 @@ S_proc_child (struct proc *parentp,
parentp->p_ochild = childp;
/* Process group structure. */
- leave_pgrp (childp);
- childp->p_pgrp = parentp->p_pgrp;
- join_pgrp (childp);
+ if (childp->p_pgrp != parentp->p_pgrp)
+ {
+ leave_pgrp (childp);
+ childp->p_pgrp = parentp->p_pgrp;
+ join_pgrp (childp);
+ }
childp->p_parentset = 1;
if (childp->p_msgport)