diff options
author | Miles Bader <miles@gnu.org> | 1996-01-27 16:53:23 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-01-27 16:53:23 +0000 |
commit | 2295793c9ecf5e24933e373204d605b8455894f8 (patch) | |
tree | 78c7b036e8c613a4ba11a216e9720689b233ea1c /libdiskfs/trans-callback.c | |
parent | 1f3162fbf57acd8b1c67d06de9397820f422cd61 (diff) |
(_diskfs_translator_callback2_fn): Use diskfs_create_protid instead of
diskfs_make_protid, and deal with an error return.
Diffstat (limited to 'libdiskfs/trans-callback.c')
-rw-r--r-- | libdiskfs/trans-callback.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/libdiskfs/trans-callback.c b/libdiskfs/trans-callback.c index cfd8a95b..7701199b 100644 --- a/libdiskfs/trans-callback.c +++ b/libdiskfs/trans-callback.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. Written by Michael I. Bushnell. This file is part of the GNU Hurd. @@ -54,16 +54,18 @@ _diskfs_translator_callback2_fn (void *cookie1, void *cookie2, { struct node *np = cookie1; mach_port_t *dotdot = cookie2; - struct protid *newpi = - diskfs_make_protid (diskfs_make_peropen (np, flags, *dotdot), - &np->dn_stat.st_uid, 1, &np->dn_stat.st_gid, 1); - - *underlying = ports_get_right (newpi); - *underlying_type = MACH_MSG_TYPE_MAKE_SEND; - - ports_port_deref (newpi); - - return 0; + struct protid *cred; + error_t err = + diskfs_create_protid (diskfs_make_peropen (np, flags, *dotdot), + &np->dn_stat.st_uid, 1, &np->dn_stat.st_gid, 1, + &cred); + if (! err) + { + *underlying = ports_get_right (cred); + *underlying_type = MACH_MSG_TYPE_MAKE_SEND; + ports_port_deref (cred); + } + return err; } fshelp_fetch_root_callback1_t _diskfs_translator_callback1 = |