aboutsummaryrefslogtreecommitdiff
path: root/libfshelp/fetch-root.c
diff options
context:
space:
mode:
Diffstat (limited to 'libfshelp/fetch-root.c')
-rw-r--r--libfshelp/fetch-root.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c
index 76839993..f5971a6f 100644
--- a/libfshelp/fetch-root.c
+++ b/libfshelp/fetch-root.c
@@ -136,8 +136,10 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
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]);
+ if (i != INIT_PORT_CWDIR)
+ mach_port_deallocate (mach_task_self (), ports[i]);
mutex_lock (box->lock);