summaryrefslogtreecommitdiff
path: root/proc/mgt.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-05-30 03:10:19 +0000
committerRoland McGrath <roland@gnu.org>1999-05-30 03:10:19 +0000
commitd1eca298a62e3eb7ebedaa0d176a1d310c1a53ce (patch)
tree62ee6b0d3d8a29a33db5400a4fb0def996506fce /proc/mgt.c
parentec68b7ccbcecdfae8aca3275fcf4e1f8d81fa7c1 (diff)
1999-05-29 Roland McGrath <roland@baalperazim.frob.com>
* mgt.c (add_tasks): Skip invalid (null) rights in tasks array. * info.c (S_proc_pid2task): Add assert for p_task right validity.
Diffstat (limited to 'proc/mgt.c')
-rw-r--r--proc/mgt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/proc/mgt.c b/proc/mgt.c
index 3f4f5f3b..cde05cd0 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -238,7 +238,7 @@ S_proc_reassign (struct proc *p,
p->p_envp = stubp->p_envp;
/* Destroy stubp */
- stubp->p_task = 0; /* block deallocation */
+ stubp->p_task = MACH_PORT_NULL;/* block deallocation */
process_has_exited (stubp);
stubp->p_waited = 1; /* fake out complete_exit */
complete_exit (stubp);
@@ -750,6 +750,12 @@ add_tasks (task_t task)
for (j = 0; j < ntasks; j++)
{
int set = 0;
+
+ /* The kernel can deliver us an array with null slots in the
+ middle, e.g. if a task died during the call. */
+ if (! MACH_PORT_VALID (tasks[j]))
+ continue;
+
if (!foundp)
{
struct proc *p = task_find_nocreate (tasks[j]);