summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-04-06 19:28:33 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-04-06 19:28:33 +0000
commitbf761682a04c0c87932b8f5f60e7ee9859acf7b6 (patch)
tree77b28d026fba3b67306bb0a3e408dbf0b77730b4 /proc
parent1a58e6028fa8f16610739409d4fc5bba52c29486 (diff)
Formerly mgt.c.~3~
Diffstat (limited to 'proc')
-rw-r--r--proc/mgt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/proc/mgt.c b/proc/mgt.c
index c4b8d0e3..37d4e43a 100644
--- a/proc/mgt.c
+++ b/proc/mgt.c
@@ -606,15 +606,20 @@ add_tasks (task_t task)
processor_set_tasks (psetpriv, &tasks, &ntasks);
for (j = 0; j < ntasks; j++)
{
+ int set = 0;
if (!foundp)
{
struct proc *p = task_find_nocreate (tasks[j]);
if (!p)
- p = new_proc (tasks[j]);
+ {
+ p = new_proc (tasks[j]);
+ set = 1;
+ }
if (!foundp && tasks[j] == task)
foundp = p;
}
- mach_port_deallocate (mach_task_self (), tasks[j]);
+ if (!set)
+ mach_port_deallocate (mach_task_self (), tasks[j]);
}
vm_deallocate (mach_task_self (), (vm_address_t) tasks,
ntasks * sizeof (task_t));