summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-08 01:25:56 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-08 01:25:56 +0000
commit4fc617fee674543e3c7f578616c63cbc1fa1e341 (patch)
tree73f531a42351818a9c3fe61b322b731ac5eaf759
parent26b644d0de824599589e5d8566126497acb1a7d2 (diff)
(fshelp_fetch_root): Don't use unsafe MOVE_SEND in call to
fshelp_start_translator_long.
-rw-r--r--libfshelp/fetch-root.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c
index b1813fd8..b38b276d 100644
--- a/libfshelp/fetch-root.c
+++ b/libfshelp/fetch-root.c
@@ -38,6 +38,7 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
error_t err;
mach_port_t control;
int cancel;
+ int i;
start_over:
@@ -128,12 +129,16 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
err = fshelp_start_translator_long (fetch_underlying,
argz, argz, argz_len,
- fds, MACH_MSG_TYPE_MOVE_SEND,
+ fds, MACH_MSG_TYPE_COPY_SEND,
STDERR_FILENO + 1,
- ports, MACH_MSG_TYPE_MOVE_SEND,
+ ports, MACH_MSG_TYPE_COPY_SEND,
INIT_PORT_MAX,
ints, INIT_INT_MAX,
0, &control);
+ for (i = 0; i <= STDERR_FILENO; i++)
+ mach_port_deallocate (mach_task_self (), fds[i]);
+ for (i = 0; i < INIT_PORT_MAX; i++)
+ mach_port_deallocate (mach_task_self (), ports[i]);
mutex_lock (box->lock);