summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exec/exec.c4
-rw-r--r--libnetfs/file-getcontrol.c17
-rw-r--r--trans/crash.c9
3 files changed, 16 insertions, 14 deletions
diff --git a/exec/exec.c b/exec/exec.c
index 040f3ed1..451cd606 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1196,10 +1196,10 @@ do_exec (file_t file,
ports_replaced[idx] = 1;
}
- boot = ports_allocate_port (port_bucket, sizeof *boot, execboot_portclass);
+ e.error = ports_create_port (port_bucket, sizeof *boot,
+ execboot_portclass, &boot);
if (boot == NULL)
{
- e.error = ENOMEM;
stdout:
rwlock_reader_unlock (&std_lock);
goto out;
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;
diff --git a/trans/crash.c b/trans/crash.c
index ee9c71f0..812c2543 100644
--- a/trans/crash.c
+++ b/trans/crash.c
@@ -1,5 +1,5 @@
/* GNU Hurd standard crash dump server.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Roland McGrath.
This file is part of the GNU Hurd.
@@ -103,10 +103,9 @@ S_crash_dump_task (mach_port_t port,
{
struct crasher *c;
- c = ports_allocate_port (port_bucket, sizeof *c, crasher_portclass);
- if (! c)
- err = ENOMEM;
- else
+ err = ports_create_port (port_bucket, sizeof *c,
+ crasher_portclass, &c);
+ if (! err)
{
/* Install our port as the crasher's msgport.
We will wait for signals to resume (crash) it. */