summaryrefslogtreecommitdiff
path: root/libnetfs/dir-lookup.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-03-17 10:30:55 +0000
committerRoland McGrath <roland@gnu.org>2000-03-17 10:30:55 +0000
commit401739df317b1dced1ce98a4367d78e385a4b843 (patch)
treeae6b5c81ca1216265734dce3ec28d06ae2426593 /libnetfs/dir-lookup.c
parent3b1ed7899c85b921c5510d2978c6e56c56d0a0d8 (diff)
2000-03-17 Roland McGrath <roland@baalperazim.frob.com>
* dir-lookup.c (netfs_S_dir_lookup): Use ports_get_send_right. Deallocate DIRPORT after fshelp_fetch_root.
Diffstat (limited to 'libnetfs/dir-lookup.c')
-rw-r--r--libnetfs/dir-lookup.c7
1 files changed, 4 insertions, 3 deletions
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)
{