summaryrefslogtreecommitdiff
path: root/libtrivfs/fsys-getroot.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-10-11 07:42:26 +0000
committerRoland McGrath <roland@gnu.org>1999-10-11 07:42:26 +0000
commitd2b8b83a78fc568b4b48bcde196bf1d585da58df (patch)
tree2377c833a5016a3d8b38510429a06b02a8f645f0 /libtrivfs/fsys-getroot.c
parent8d004d675bffdad6c82ef2c4408da6a74094c17b (diff)
1999-10-11 Roland McGrath <roland@baalperazim.frob.com>
* trivfs.h (trivfs_open_hook): New variable. * fsys-getroot.c (trivfs_S_fsys_getroot): Use it.
Diffstat (limited to 'libtrivfs/fsys-getroot.c')
-rw-r--r--libtrivfs/fsys-getroot.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c
index 9d173f9a..ed23dd94 100644
--- a/libtrivfs/fsys-getroot.c
+++ b/libtrivfs/fsys-getroot.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation
+ Copyright (C) 1993,94,95,97,99 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -8,7 +8,7 @@ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
-The GNU Hurd is distributed in the hope that it will be useful,
+The GNU Hurd is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@@ -63,7 +63,7 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
return EOPNOTSUPP;
/* O_CREAT and O_EXCL are not meaningful here; O_NOLINK and O_NOTRANS
- will only be useful when trivfs supports translators (which it doesn't
+ will only be useful when trivfs supports translators (which it doesn't
now). */
flags &= O_HURD;
flags &= ~(O_CREAT|O_EXCL|O_NOLINK|O_NOTRANS);
@@ -91,7 +91,17 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
if (!err && trivfs_check_open_hook)
err = (*trivfs_check_open_hook) (cntl, user, flags);
if (!err)
- err = trivfs_open (cntl, user, flags, new_realnode, &cred);
+ {
+ if (! trivfs_open_hook)
+ {
+ err = trivfs_open (cntl, user, flags, new_realnode, &cred);
+ if (!err)
+ mach_port_deallocate (mach_task_self (), dotdot);
+ }
+ else
+ err = (*trivfs_open_hook) (cntl, user, dotdot, flags, new_realnode,
+ &cred);
+ }
if (err)
{
@@ -105,7 +115,6 @@ trivfs_S_fsys_getroot (struct trivfs_control *cntl,
*newpt = ports_get_right (cred);
*newpttype = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (cred);
- mach_port_deallocate (mach_task_self (), dotdot);
}
return err;