summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-08-19 21:47:02 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-08-19 21:47:02 +0000
commit464af75ec05c5594238c5dd3f59db64fbc08c060 (patch)
tree1025c9f035f0855688b8927b36c58872824c778a
parentb8dc314192b752f190ef4f22c861895a86a5c316 (diff)
Formerly pgrp.c.~11~
-rw-r--r--proc/pgrp.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/proc/pgrp.c b/proc/pgrp.c
index 5caedb00..f65d5427 100644
--- a/proc/pgrp.c
+++ b/proc/pgrp.c
@@ -223,15 +223,20 @@ S_proc_getpgrppids (struct proc *callerp,
pid_t **pids,
u_int *npidsp)
{
- int count;
+
struct proc *p;
struct pgrp *pg;
pid_t *pp = *pids;
int npids = *npidsp;
- pg = pgrp_find (pgid);
- if (!pg)
- return ESRCH;
+ if (pgid == 0)
+ pg = callerp->p_pgrp;
+ else
+ {
+ pg = pgrp_find (pgid);
+ if (!pg)
+ return ESRCH;
+ }
count = 0;
for (p = pg->pg_plist; p; p = p->p_gnext)