summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-08-17 18:09:22 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-08-17 18:09:22 +0000
commitaf1647d6db4fde50056665f85c53c4f0efdf974c (patch)
tree6e1aadf1d6fddaeddc714cd0f7df0e30d6fea299 /proc
parente0d4b8289f8346c56fe737923c7a293b91ae83ba (diff)
Formerly host.c.~7~
Diffstat (limited to 'proc')
-rw-r--r--proc/host.c41
1 files changed, 4 insertions, 37 deletions
diff --git a/proc/host.c b/proc/host.c
index 72da687f..9ddf5a39 100644
--- a/proc/host.c
+++ b/proc/host.c
@@ -141,37 +141,6 @@ S_proc_getprivports (struct proc *p,
return 0;
}
-/* Initialize the standard exec ports and ints. */
-void
-init_stdarrays ()
-{
- auth_t nullauth;
- mach_port_t pt;
- int pid = getpid ();
-
- std_port_array = malloc (sizeof (mach_port_t) * INIT_PORT_MAX);
- std_int_array = malloc (sizeof (int) * INIT_INT_MAX);
-
- bzero (std_port_array, sizeof (mach_port_t) * INIT_PORT_MAX);
- bzero (std_int_array, sizeof (int) * INIT_INT_MAX);
-
- __USEPORT (AUTH, auth_makeauth (port, 0, MACH_MSG_TYPE_COPY_SEND, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, &nullauth));
-
- pt = getcwdir ();
- io_reauthenticate (pt, pid);
- auth_user_authenticate (nullauth, pt, pid, &std_port_array[INIT_PORT_CWDIR]);
- mach_port_deallocate (mach_task_self (), pt);
-
- pt = getcrdir ();
- io_reauthenticate (pt, pid);
- auth_user_authenticate (nullauth, pt, pid, &std_port_array[INIT_PORT_CRDIR]);
- mach_port_deallocate (mach_task_self (), pt);
-
- std_port_array[INIT_PORT_AUTH] = nullauth;
-
- std_int_array[INIT_UMASK] = CMASK;
-}
/* Implement proc_setexecdata as described in <hurd/proc.defs>. */
kern_return_t
@@ -223,7 +192,7 @@ S_proc_getexecdata (struct proc *p,
/* XXX memory leak here */
if (!std_port_array)
- init_stdarrays ();
+ return ENOENT;
if (*nports < n_std_ports)
*ports = malloc (n_std_ports * sizeof (mach_port_t));
@@ -258,11 +227,9 @@ S_proc_execdata_notify (struct proc *p,
if (foo)
mach_port_deallocate (mach_task_self (), foo);
- if (!std_port_array)
- init_stdarrays ();
-
- exec_setexecdata (n->notify_port, std_port_array, MACH_MSG_TYPE_COPY_SEND,
- n_std_ports, std_int_array, n_std_ints);
+ if (std_port_array)
+ exec_setexecdata (n->notify_port, std_port_array, MACH_MSG_TYPE_COPY_SEND,
+ n_std_ports, std_int_array, n_std_ints);
return 0;
}