summaryrefslogtreecommitdiff
path: root/libfshelp/start-translator-long.c
diff options
context:
space:
mode:
Diffstat (limited to 'libfshelp/start-translator-long.c')
-rw-r--r--libfshelp/start-translator-long.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c
index 25baa0f2..cfa0319a 100644
--- a/libfshelp/start-translator-long.c
+++ b/libfshelp/start-translator-long.c
@@ -165,7 +165,7 @@ fshelp_start_translator_long (file_t underlying,
{
error_t err;
file_t executable;
- mach_port_t bootstrap, task, prev_notify, proc;
+ mach_port_t bootstrap, task, prev_notify, proc, saveport;
int ports_moved = 0;
/* Find the translator itself. Since argz has zero-separated elements, we
@@ -212,6 +212,7 @@ fshelp_start_translator_long (file_t underlying,
default:
abort ();
}
+ saveport = ports[INIT_PORT_BOOTSTRAP];
ports[INIT_PORT_BOOTSTRAP] = bootstrap;
/* Try and exec the translator in TASK... */
@@ -220,6 +221,9 @@ fshelp_start_translator_long (file_t underlying,
fds, fds_type, fds_len,
ports, ports_type, ports_len,
ints, ints_len, 0, 0, 0, 0);
+ if (ports_type == MACH_MSG_TYPE_COPY_SEND)
+ mach_port_deallocate (mach_task_self (), bootstrap);
+ ports[INIT_PORT_BOOTSTRAP] = saveport;
ports_moved = 1;
if (err)
goto lose;