summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-04-05 20:26:55 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-04-05 20:26:55 +0000
commit68f8c18fbb4f9c845f392fd36f292059c4db1420 (patch)
tree76e3f4f1dec81c64a19e359df52f2e9f8fb8d48e
parentaff13c6581a8ef62df02bdea67814de34cc74083 (diff)
Formerly pgrp.c.~3~
-rw-r--r--proc/pgrp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proc/pgrp.c b/proc/pgrp.c
index ea500fee..ea64ede7 100644
--- a/proc/pgrp.c
+++ b/proc/pgrp.c
@@ -371,7 +371,10 @@ join_pgrp (struct proc *p)
pg->pg_plist->p_gprevp = &p->p_gnext;
pg->pg_plist = p;
- if (p->p_parent->p_pgrp != pg
+ /* Processes 0 and 1 have no parent; they count as orphaned
+ processes always. */
+ if (p->p_parent
+ && p->p_parent->p_pgrp != pg
&& p->p_parent->p_pgrp->pg_session == pg->pg_session)
pg->pg_orphcnt++;
}