From 401739df317b1dced1ce98a4367d78e385a4b843 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 17 Mar 2000 10:30:55 +0000 Subject: 2000-03-17 Roland McGrath * dir-lookup.c (netfs_S_dir_lookup): Use ports_get_send_right. Deallocate DIRPORT after fshelp_fetch_root. --- libnetfs/dir-lookup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libnetfs') diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index 5019017b..6b5cfda9 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -238,9 +238,7 @@ netfs_S_dir_lookup (struct protid *diruser, netfs_make_protid (netfs_make_peropen (dnp, 0, diruser->po), iohelp_create_iouser (make_idvec (), make_idvec ())); - dirport = ports_get_right (newpi); - mach_port_insert_right (mach_task_self (), dirport, dirport, - MACH_MSG_TYPE_MAKE_SEND); + dirport = ports_get_send_right (newpi); ports_port_deref (newpi); error = fshelp_fetch_root (&np->transbox, diruser->po, @@ -252,6 +250,9 @@ netfs_S_dir_lookup (struct protid *diruser, : short_circuited_callback1), _netfs_translator_callback2, do_retry, retry_name, retry_port); + /* fetch_root copies DIRPORT for success, so we always should + deallocate our send right. */ + mach_port_deallocate (mach_task_self (), dirport); if (error != ENOENT) { -- cgit v1.2.3