summaryrefslogtreecommitdiff
path: root/libdiskfs/init-startup.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-02-13 09:19:17 +0000
committerThomas Bushnell <thomas@gnu.org>1999-02-13 09:19:17 +0000
commitdbe1211d027346c1e61a7befdb930ae64758329e (patch)
tree99e7553acbddabc3c617d68ee250deb08699eb54 /libdiskfs/init-startup.c
parentc8d2da69861cf22e740b26d81e326d1e02835d56 (diff)
1999-02-12 Gordon Matzigkeit <gord@trick.fig.org>
* init-startup.c (diskfs_startup_diskfs): Release the virtual root's lock as soon as we've checked that it's a valid directory. Ignore leading slashes in _diskfs_chroot_directory.
Diffstat (limited to 'libdiskfs/init-startup.c')
-rw-r--r--libdiskfs/init-startup.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libdiskfs/init-startup.c b/libdiskfs/init-startup.c
index ea77283c..355a66ae 100644
--- a/libdiskfs/init-startup.c
+++ b/libdiskfs/init-startup.c
@@ -1,5 +1,5 @@
/* diskfs_startup_diskfs -- advertise our fsys control port to our parent FS.
- Copyright (C) 1994, 1995, 1996, 1998 Free Software Foundation
+ Copyright (C) 1994, 1995, 1996, 1998, 1999 Free Software Foundation
This file is part of the GNU Hurd.
@@ -43,6 +43,10 @@ diskfs_startup_diskfs (mach_port_t bootstrap, int flags)
struct node *np, *old;
struct protid *rootpi;
+ /* Skip leading slashes */
+ while (_diskfs_chroot_directory == '/')
+ _diskfs_chroot_directory++;
+
mutex_lock (&diskfs_root_node->lock);
/* Create a protid we can use in diskfs_lookup. */
@@ -75,6 +79,7 @@ diskfs_startup_diskfs (mach_port_t bootstrap, int flags)
if _diskfs_chroot_directory is non-null. */
old = diskfs_root_node;
diskfs_root_node = np;
+ mutex_unlock (&np->lock);
diskfs_nput (old);
}