summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-08 01:19:13 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-08 01:19:13 +0000
commit418808127512d3e02d11ef0ea5a25444a9a7c7cc (patch)
tree2f9fd039f943fbeb1d6da5d21388203ca2a8d4a1
parentd3bc8291eb7f87a1a1892a4c32d4fcfa3d986f26 (diff)
(init_stdarrays): Don't use unsafe MOVE_SEND in call to interruptible
proc_setexecdata. (open_console): Likewise, for file_set_translator.
-rw-r--r--init/init.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c
index d62451a6..f1077a66 100644
--- a/init/init.c
+++ b/init/init.c
@@ -888,6 +888,7 @@ init_stdarrays ()
mach_port_t ref;
mach_port_t *std_port_array;
int *std_int_array;
+ int i;
std_port_array = alloca (sizeof (mach_port_t) * INIT_PORT_MAX);
std_int_array = alloca (sizeof (int) * INIT_INT_MAX);
@@ -919,8 +920,10 @@ init_stdarrays ()
std_int_array[INIT_UMASK] = CMASK;
__USEPORT (PROC, proc_setexecdata (port, std_port_array,
- MACH_MSG_TYPE_MOVE_SEND, INIT_PORT_MAX,
+ MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
std_int_array, INIT_INT_MAX));
+ for (i = 0; i < INIT_PORT_MAX; i++)
+ mach_port_deallocate (mach_task_self (), std_port_array[i]);
}
/* Open /dev/console. If it isn't there, or it isn't a terminal, then
@@ -1013,7 +1016,8 @@ open_console ()
}
errno = file_set_translator (term, 0, FS_TRANS_SET, 0, 0, 0,
- control, MACH_MSG_TYPE_MOVE_SEND);
+ control, MACH_MSG_TYPE_COPY_SEND);
+ mach_port_deallocate (mach_task_self (), control);
if (errno)
{
error (0, errno, "%s", termname);