diff options
author | Miles Bader <miles@gnu.org> | 1996-01-27 17:30:40 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-01-27 17:30:40 +0000 |
commit | b05df6c9bc16784be16f63f9cf651ddbdd54d37e (patch) | |
tree | d142d1772ceb7fc66dd7bd534452597f6df3560a /libtrivfs | |
parent | e8b99aee42487f2ad07e6e0190bfc75076102e84 (diff) |
(trivfs_startup): Use trivfs_create_control.
Diffstat (limited to 'libtrivfs')
-rw-r--r-- | libtrivfs/startup.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/libtrivfs/startup.c b/libtrivfs/startup.c index 487276a0..3783efc2 100644 --- a/libtrivfs/startup.c +++ b/libtrivfs/startup.c @@ -38,30 +38,31 @@ trivfs_startup(mach_port_t bootstrap, int flags, struct port_bucket *protid_bucket, struct trivfs_control **control) { - error_t err; - mach_port_t realnode; - struct trivfs_control *tcntl; - mach_port_t mcntl = - trivfs_handle_port (MACH_PORT_NULL, control_class, control_bucket, - protid_class, protid_bucket); + mach_port_t underlying, right; + struct trivfs_control *fsys; + error_t err = + trivfs_create_control (MACH_PORT_NULL, + control_class, control_bucket, + protid_class, protid_bucket, + &fsys); - assert(mcntl != MACH_PORT_NULL); + if (err) + return err; - /* Contact whoever started us. */ - err = - fsys_startup (bootstrap, flags, mcntl, MACH_MSG_TYPE_MAKE_SEND, &realnode); + right = ports_get_right (fsys); - /* Install the returned realnode for trivfs's use */ - tcntl = ports_lookup_port (control_bucket, mcntl, control_class); - assert (tcntl); + /* Contact whoever started us. */ + err = fsys_startup (bootstrap, flags, right, MACH_MSG_TYPE_MAKE_SEND, + &underlying); - if (!err) - tcntl->underlying = realnode; + if (! err) + fsys->underlying = underlying; - ports_port_deref (tcntl); + ports_port_deref (fsys); - if (control) - *control = tcntl; + /* Pass back what we got, unless the caller doesn't want it. */ + if (!err && control) + *control = fsys; return err; } |