summaryrefslogtreecommitdiff
path: root/boot/boot.c
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-11-01 18:02:34 +0100
committerJustus Winter <justus@gnupg.org>2016-11-01 18:04:29 +0100
commit0bc74163d5406e305b84f8f51dbce097bb46fa90 (patch)
tree4d93779fdec2adbf65ec61e4656945296d422039 /boot/boot.c
parent61f89952020ff1ff34e391ae78acd2da51476c41 (diff)
Adjust to the fixed new task notifications.
* boot/boot.c (S_mach_notify_new_task): The send rights are now indeed moved to the target task, adjust accordingly. * proc/mgt.c (S_mach_notify_new_task): Likewise.
Diffstat (limited to 'boot/boot.c')
-rw-r--r--boot/boot.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/boot/boot.c b/boot/boot.c
index db5c3964..f7c7d77f 100644
--- a/boot/boot.c
+++ b/boot/boot.c
@@ -1942,6 +1942,7 @@ S_mach_notify_new_task (mach_port_t notify,
goto fail;
assert (! MACH_PORT_VALID (previous));
+ mach_port_mod_refs (mach_task_self (), task, MACH_PORT_RIGHT_SEND, +1);
err = hurd_ihash_add (&task_ihash,
(hurd_ihash_key_t) task, (hurd_ihash_value_t) task);
if (err)
@@ -1951,9 +1952,10 @@ S_mach_notify_new_task (mach_port_t notify,
}
if (MACH_PORT_VALID (new_task_notification))
- /* Relay the notification. */
- mach_notify_new_task (new_task_notification, task, parent);
+ /* Relay the notification. This consumes task and parent. */
+ return mach_notify_new_task (new_task_notification, task, parent);
+ mach_port_deallocate (mach_task_self (), task);
mach_port_deallocate (mach_task_self (), parent);
return 0;