From cd12cc27adc2291caf5a4014eab176a17af4f5d0 Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Sat, 28 Dec 2019 23:44:30 +0100
Subject: libfshelp: Fix errno value leak

When the last translator box contains a port to a died translator, we do
not want to consider this as a whole failure.

* libfshelp/translator-list.c (fshelp_get_active_translators): On
mach_port_mod_refs failure, reset err to 0.
---
 libfshelp/translator-list.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'libfshelp')

diff --git a/libfshelp/translator-list.c b/libfshelp/translator-list.c
index 92b31dd0..63088fe9 100644
--- a/libfshelp/translator-list.c
+++ b/libfshelp/translator-list.c
@@ -219,7 +219,10 @@ fshelp_get_active_translators (char **translators,
       err = mach_port_mod_refs (mach_task_self (), t->active,
 				MACH_PORT_RIGHT_SEND, +1);
       if (err)
-	continue;
+	{
+	  err = 0;
+	  continue;
+	}
       (*controls)[*controls_count] = t->active;
       (*controls_count)++;
 
-- 
cgit v1.2.3