aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/boot-start.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-12-30 06:50:40 +0000
committerRoland McGrath <roland@gnu.org>1998-12-30 06:50:40 +0000
commit426351562d55a06e490fad6a87cd7d0106280ab6 (patch)
tree68b935f19834e5fd0b2addcb7e00bfa3a4f9e4dc /libdiskfs/boot-start.c
parent05361f6e96c9b7abaca44e16cf38e9f8bc0475e2 (diff)
downloadhurd-426351562d55a06e490fad6a87cd7d0106280ab6.tar.gz
hurd-426351562d55a06e490fad6a87cd7d0106280ab6.tar.bz2
hurd-426351562d55a06e490fad6a87cd7d0106280ab6.zip
1998-12-27 Roland McGrath <roland@baalperazim.frob.com>
Use a struct hurd_port for the cached exec server port, so it is properly reference-counted and locked. * boot-start.c (diskfs_exec): Variable removed. (diskfs_start_bootstrap): Make it a local here. Install that port in _diskfs_exec_portcell. (diskfs_S_fsys_init): Use _diskfs_exec_portcell instead of diskfs_exec. * init-init.c (_diskfs_exec_portcell): New variable. (diskfs_init_diskfs): Initialize it. * priv.h: Declare it. * diskfs.h (diskfs_exec, diskfs_exec_ctl): Remove decls. * file-exec.c (diskfs_S_file_exec): Use _diskfs_exec_portcell instead of diskfs_exec.
Diffstat (limited to 'libdiskfs/boot-start.c')
-rw-r--r--libdiskfs/boot-start.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index 21fc9656..c968cf31 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -36,7 +36,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "fsys_reply_U.h"
static mach_port_t diskfs_exec_ctl;
-mach_port_t diskfs_exec = MACH_PORT_NULL;
extern task_t diskfs_exec_server_task;
static task_t parent_task = MACH_PORT_NULL;
@@ -101,6 +100,7 @@ diskfs_start_bootstrap ()
size_t exec_argvlen;
struct port_info *bootinfo;
struct protid *rootpi;
+ mach_port_t diskfs_exec;
/* Create the port for current and root directory. */
err = diskfs_create_protid (diskfs_make_peropen (diskfs_root_node,
@@ -295,6 +295,9 @@ diskfs_start_bootstrap ()
mach_port_deallocate (mach_task_self (), startup_pt);
mach_port_deallocate (mach_task_self (), bootpt);
assert_perror (err);
+
+ /* Cache the exec server port for file_exec to use. */
+ _hurd_port_set (&_diskfs_exec_portcell, diskfs_exec);
}
/* We look like an execserver to the execserver itself; it makes this
@@ -503,8 +506,9 @@ diskfs_S_fsys_init (mach_port_t port,
/* Don't start this until now so that exec is fully authenticated
with proc. */
- exec_init (diskfs_exec, authhandle,
- execprocess, MACH_MSG_TYPE_COPY_SEND);
+ HURD_PORT_USE (&_diskfs_exec_portcell,
+ exec_init (port, authhandle,
+ execprocess, MACH_MSG_TYPE_COPY_SEND));
mach_port_deallocate (mach_task_self (), execprocess);
/* We don't need this anymore. */