summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proc/msg.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/proc/msg.c b/proc/msg.c
index ea5490a4..a84418f6 100644
--- a/proc/msg.c
+++ b/proc/msg.c
@@ -53,15 +53,18 @@ S_proc_setmsgport (struct proc *p,
prociterate (check_message_return, p);
p->p_checkmsghangs = 0;
- /* init is single-threaded. Reply to it before we expect it
- to service requests. */
- proc_setmsgport_reply (reply, replytype, 0, p->p_msgport);
-
if (p == startup_proc)
- startup_essential_task (msgport, mach_task_self (), MACH_PORT_NULL,
- "proc", master_host_port);
-
- return MIG_NO_REPLY;
+ {
+ /* init is single-threaded. Reply to it before we expect it
+ to service requests. */
+ proc_setmsgport_reply (reply, replytype, 0, *oldmsgport);
+ mach_port_deallocate (mach_task_self (), *oldmsgport);
+ startup_essential_task (msgport, mach_task_self (), MACH_PORT_NULL,
+ "proc", master_host_port);
+ return MIG_NO_REPLY;
+ }
+ else
+ return 0;
}
/* Check to see if process P is blocked trying to get the message port of