summaryrefslogtreecommitdiff
path: root/libfshelp
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-08 01:27:51 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-08 01:27:51 +0000
commit6095be9462f3920115940c2e4a8608d03e8f1331 (patch)
tree6c864fbfcb9ad2957717f4fcd679606cab10786c /libfshelp
parent4fc617fee674543e3c7f578616c63cbc1fa1e341 (diff)
(fshelp_start_translator): Don't use unsafe MOVE_SEND in call to
fshelp_start_translator_long.
Diffstat (limited to 'libfshelp')
-rw-r--r--libfshelp/start-translator.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/libfshelp/start-translator.c b/libfshelp/start-translator.c
index f7b5523d..f5cc4072 100644
--- a/libfshelp/start-translator.c
+++ b/libfshelp/start-translator.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Michael I. Bushnell.
This file is part of the GNU Hurd.
@@ -32,6 +32,7 @@ fshelp_start_translator (fshelp_open_fn_t underlying_open_fn,
mach_port_t fds[STDERR_FILENO + 1];
int ints[INIT_INT_MAX];
int i;
+ error_t err;
for (i = 0; i < INIT_PORT_MAX; i++)
ports[i] = MACH_PORT_NULL;
@@ -44,12 +45,18 @@ fshelp_start_translator (fshelp_open_fn_t underlying_open_fn,
ports[INIT_PORT_AUTH] = getauth ();
fds[STDERR_FILENO] = getdport (STDERR_FILENO);
- return fshelp_start_translator_long (underlying_open_fn,
- name, argz, argz_len,
- fds, MACH_MSG_TYPE_MOVE_SEND,
- STDERR_FILENO + 1,
- ports, MACH_MSG_TYPE_MOVE_SEND,
- INIT_PORT_MAX,
- ints, INIT_INT_MAX,
- timeout, control);
+ err = fshelp_start_translator_long (underlying_open_fn,
+ name, argz, argz_len,
+ fds, MACH_MSG_TYPE_COPY_SEND,
+ STDERR_FILENO + 1,
+ ports, MACH_MSG_TYPE_COPY_SEND,
+ INIT_PORT_MAX,
+ ints, INIT_INT_MAX,
+ timeout, control);
+ for (i = 0; i < INIT_PORT_MAX; i++)
+ mach_port_deallocate (mach_task_self (), ports[i]);
+ for (i = 0; i <= STDERR_FILENO; i++)
+ mach_port_deallocate (mach_task_self (), fds[i]);
+
+ return err;
}