summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libfshelp/fetch-root.c2
-rw-r--r--libshouldbeinlibc/exec-reauth.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c
index 54d3c0ca..eb569896 100644
--- a/libfshelp/fetch-root.c
+++ b/libfshelp/fetch-root.c
@@ -79,7 +79,7 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
if (err)
ret = MACH_PORT_NULL;
- mach_port_destroy (mach_task_self (), rend);
+ mach_port_mod_refs (mach_task_self (), rend, MACH_PORT_RIGHT_RECEIVE, -1);
return ret;
}
diff --git a/libshouldbeinlibc/exec-reauth.c b/libshouldbeinlibc/exec-reauth.c
index fa4aa59e..263b1408 100644
--- a/libshouldbeinlibc/exec-reauth.c
+++ b/libshouldbeinlibc/exec-reauth.c
@@ -59,7 +59,7 @@ exec_reauth (auth_t auth, int secure, int must_reauth,
if (!err)
err = auth_user_authenticate (auth, ref, MACH_MSG_TYPE_MAKE_SEND,
&newport);
- mach_port_destroy (mach_task_self (), ref);
+ mach_port_mod_refs (mach_task_self (), ref, MACH_PORT_RIGHT_RECEIVE, -1);
if (err)
{
if (must_reauth)