From db11702623a95a0bc7483a93f58b22d451042613 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Fri, 18 Feb 1994 21:07:56 +0000 Subject: Formerly fsys-getroot.c.~2~ --- libtrivfs/fsys-getroot.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libtrivfs/fsys-getroot.c') diff --git a/libtrivfs/fsys-getroot.c b/libtrivfs/fsys-getroot.c index 7820aec9..52089ac4 100644 --- a/libtrivfs/fsys-getroot.c +++ b/libtrivfs/fsys-getroot.c @@ -31,12 +31,20 @@ trivfs_S_fsys_getroot (mach_port_t fsys, { struct protid *cred; int i; + struct port_info *pi; + + pi = ports_get_port (fsys, PT_CTL); + if (!pi) + return EOPNOTSUPP; assert (!trivfs_support_read && !trivfs_support_write && !trivfs_support_exec); if (flags & (O_READ|O_WRITE|O_EXEC)) - return EACCES; + { + ports_done_with_port (pi); + return EACCES; + } cred = ports_allocate_port (sizeof (struct protid), PT_PROTID); cred->isroot = 0; @@ -47,6 +55,7 @@ trivfs_S_fsys_getroot (mach_port_t fsys, uids, nuids, gids, ngids); *newpt = ports_get_right (cred); *newpttype = MACH_MSG_TYPE_MAKE_SEND; + ports_done_with_port (pi); return 0; } -- cgit v1.2.3