From 2295793c9ecf5e24933e373204d605b8455894f8 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 27 Jan 1996 16:53:23 +0000 Subject: (_diskfs_translator_callback2_fn): Use diskfs_create_protid instead of diskfs_make_protid, and deal with an error return. --- libdiskfs/trans-callback.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'libdiskfs') 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 = -- cgit v1.2.3