diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-08-01 02:48:02 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-08-01 02:52:48 +0200 |
commit | ab2e7968332efa23f75bf68ee6b04a66c2ba6c72 (patch) | |
tree | b0ada340beae9e578593d600a2ed63f551972db3 /libdiskfs/boot-start.c | |
parent | f4f9ad3420d089d99527018f62dca02e637d7af4 (diff) | |
download | hurd-ab2e7968332efa23f75bf68ee6b04a66c2ba6c72.tar.gz hurd-ab2e7968332efa23f75bf68ee6b04a66c2ba6c72.tar.bz2 hurd-ab2e7968332efa23f75bf68ee6b04a66c2ba6c72.zip |
Fix libdiskfs bootstrap race condition
exec_exec() probably triggers a call to file_exec(), so the exec server
port needs to be cached earlier.
* libdiskfs/boot-start.c: Move caching the exec server port to just
after initializing it.
Diffstat (limited to 'libdiskfs/boot-start.c')
-rw-r--r-- | libdiskfs/boot-start.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c index ad3cf1a4..e73e4d37 100644 --- a/libdiskfs/boot-start.c +++ b/libdiskfs/boot-start.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1993,94,95,96,97,98,99,2000,01,02 + Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,10 Free Software Foundation, Inc. This file is part of the GNU Hurd. @@ -194,6 +194,9 @@ diskfs_start_bootstrap () diskfs_exec_ctl = MACH_PORT_NULL; /* Not used after this. */ } + /* Cache the exec server port for file_exec to use. */ + _hurd_port_set (&_diskfs_exec_portcell, diskfs_exec); + if (_diskfs_boot_command) { /* We have a boot command line to run instead of init. */ @@ -276,9 +279,6 @@ 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 |