From b30813c7b942f1146def88ac52f8179947294e49 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Sun, 20 Nov 2011 09:56:18 +0100 Subject: Just destroy port rights in default_pager * mach-defpager/default_pager.c (seqnos_memory_object_terminate): Simply call `mach_port_destroy' instead of managing rights through `mach_port_mod_refs'. --- mach-defpager/default_pager.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'mach-defpager') diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 82619b4b..07274553 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -2514,30 +2514,11 @@ ddprintf ("seqnos_memory_object_terminate <%p>: pager_port_unlock: <%p>[s:%d,r:% pager_port_unlock(ds); /* - * Now we deallocate our various port rights. + * Now we destroy our port rights. */ - kr = mach_port_get_refs(default_pager_self, pager_request, - MACH_PORT_RIGHT_SEND, &request_refs); - kr = mach_port_mod_refs(default_pager_self, pager_request, - MACH_PORT_RIGHT_SEND, -request_refs); - if (kr != KERN_SUCCESS) - panic(here,my_name); - - kr = mach_port_mod_refs(default_pager_self, pager_request, - MACH_PORT_RIGHT_RECEIVE, -1); - if (kr != KERN_SUCCESS) - panic(here,my_name); - - kr = mach_port_mod_refs(default_pager_self, pager_name, - MACH_PORT_RIGHT_SEND, -name_refs); - if (kr != KERN_SUCCESS) - panic(here,my_name); - - kr = mach_port_mod_refs(default_pager_self, pager_name, - MACH_PORT_RIGHT_RECEIVE, -1); - if (kr != KERN_SUCCESS) - panic(here,my_name); + mach_port_destroy(mach_task_self(), pager_request); + mach_port_destroy(mach_task_self(), pager_name); return (KERN_SUCCESS); } -- cgit v1.2.3