summaryrefslogtreecommitdiff
path: root/libtrivfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-01-27 17:29:50 +0000
committerMiles Bader <miles@gnu.org>1996-01-27 17:29:50 +0000
commite8b99aee42487f2ad07e6e0190bfc75076102e84 (patch)
treebec0e089f7e0956ffe542adadc81e99332c88176 /libtrivfs
parentc1335b38f470aa2acc5adfa5dca48c7a373d39de (diff)
(trivfs_handle_port): Use trivfs_create_control.
Diffstat (limited to 'libtrivfs')
-rw-r--r--libtrivfs/handle-port.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/libtrivfs/handle-port.c b/libtrivfs/handle-port.c
index 446aa082..e96a2dd3 100644
--- a/libtrivfs/handle-port.c
+++ b/libtrivfs/handle-port.c
@@ -17,6 +17,7 @@
#include "priv.h"
+/* Backwards compatibility. Use trivfs_create_control. */
mach_port_t
trivfs_handle_port (mach_port_t realnode,
struct port_class *control_class,
@@ -24,17 +25,19 @@ trivfs_handle_port (mach_port_t realnode,
struct port_class *protid_class,
struct port_bucket *protid_bucket)
{
- struct trivfs_control *cntl;
mach_port_t right;
-
- cntl = ports_allocate_port (control_bucket,
- sizeof (struct trivfs_control), control_class);
- cntl->underlying = realnode;
- cntl->protid_class = protid_class;
- cntl->protid_bucket = protid_bucket;
- cntl->hook = 0;
- mutex_init (&cntl->lock);
- right = ports_get_right (cntl);
- ports_port_deref (cntl);
+ struct trivfs_control *control;
+ error_t err =
+ trivfs_create_control (realnode,
+ control_class, control_bucket,
+ protid_class, protid_bucket,
+ &control);
+
+ if (err)
+ return MACH_PORT_NULL;
+
+ right = ports_get_right (control);
+ ports_port_deref (control);
+
return right;
}