summaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-04-27 10:03:04 +0000
committerRoland McGrath <roland@gnu.org>1996-04-27 10:03:04 +0000
commitf89dd27b65eb3fe12309c182e784b46df5d0d65b (patch)
treeda9379af83752ce700c6757b646513ec9f53833f /libnetfs
parent569d59b2be7a0d353303dbc9eb939b3993171c22 (diff)
Use ports_create_port instead of ports_allocate_port, and notice the error.
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/file-getcontrol.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libnetfs/file-getcontrol.c b/libnetfs/file-getcontrol.c
index 7c4f1fee..0201577b 100644
--- a/libnetfs/file-getcontrol.c
+++ b/libnetfs/file-getcontrol.c
@@ -1,5 +1,5 @@
/* Return the filesystem corresponding to a file
-
+
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
@@ -27,6 +27,7 @@ netfs_S_file_getcontrol (struct protid *user,
mach_port_t *control,
mach_msg_type_name_t *controltype)
{
+ error_t err;
struct port_info *pi;
uid_t *uids, *gids;
int nuids, ngids;
@@ -34,26 +35,28 @@ netfs_S_file_getcontrol (struct protid *user,
if (!user)
return EOPNOTSUPP;
-
+
mutex_lock (&user->po->np->lock);
netfs_interpret_credential (user->credential, &uids, &nuids, &gids, &ngids);
mutex_unlock (&user->po->np->lock);
free (gids);
-
+
for (i = 0; i < nuids; i++)
if (uids[i] == 0)
{
/* They've got root; give it to them. */
free (uids);
- pi = ports_allocate_port (netfs_port_bucket,
- sizeof (struct port_info),
- netfs_control_class);
+ err = ports_create_port (netfs_port_bucket,
+ sizeof (struct port_info),
+ netfs_control_class, &pi);
+ if (err)
+ return err;
*control = ports_get_right (pi);
*controltype = MACH_MSG_TYPE_MAKE_SEND;
ports_port_deref (pi);
return 0;
}
-
+
/* Not got root. */
free (uids);
return EPERM;