From ff88e4aa1d70f2ef218080daf01282f38243d914 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 8 May 2021 12:03:34 +0200 Subject: Revert "fshelp: Fix fetching control ports." This reverts commit 7b9011628ec0dea3e01b19b75013ce5cf5b9c841. We do want to release dead names, and not report the KERN_INVALID_RIGHT error, just return that there is no translator any more. As suggested by Sergey Bugaev --- libfshelp/fetch-control.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libfshelp') diff --git a/libfshelp/fetch-control.c b/libfshelp/fetch-control.c index 3b05e11f..0a11197a 100644 --- a/libfshelp/fetch-control.c +++ b/libfshelp/fetch-control.c @@ -32,7 +32,11 @@ fshelp_fetch_control (struct transbox *box, MACH_PORT_RIGHT_SEND, 1); if (err == KERN_INVALID_RIGHT) - *control = box->active = MACH_PORT_NULL; + { + err = mach_port_deallocate (mach_task_self (), *control); + assert_perror_backtrace (err); + *control = box->active = MACH_PORT_NULL; + } return err; } -- cgit v1.2.3