chiark / gitweb /
fishdescriptor: Fix a tuple bug in fd permutation
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 11 May 2018 15:59:05 +0000 (16:59 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 7 Jun 2018 16:28:49 +0000 (17:28 +0100)
The fd permutation algorithm would fail in nontrivial cases because it
tries to update individual members of the tupes in the fdmap.  That is
not permitted in Python.  Make the tuples into lists.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
fishdescriptor/fishdescriptor

index 77e9e68..d583533 100755 (executable)
@@ -62,7 +62,7 @@ def implement_pending():
     for (nominal, there), actual in zip(pending, actuals):
         overwriting_info = fdmap.get(nominal)
         if overwriting_info is not None: os.close(overwriting_info[0])
-        fdmap[nominal] = (actual, donor, there)
+        fdmap[nominal] = [actual, donor, there]
 
 def implement_sockinfo(nominal):
     (actual, tdonor, there) = fdmap[nominal]