chiark / gitweb /
fishdescriptor: bugfixes
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 24 Oct 2017 16:22:15 +0000 (17:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Oct 2017 16:22:15 +0000 (17:22 +0100)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
fishdescriptor/fishdescriptor

index 34d91e6..703717c 100755 (executable)
@@ -4,6 +4,8 @@ import sys
 import fishdescriptor.fish
 import optparse
 import re
+import subprocess
+import socket
 
 donor = None
 
@@ -37,9 +39,9 @@ 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 implmement_sockinfo(nominal):
+def implement_sockinfo(nominal):
     (actual, tdonor, there) = fdmap[nominal]
     # socket.fromfd requires the AF.  But of course we don't know the AF.
     # There isn't a sane way to get it in Python:
@@ -66,7 +68,7 @@ def implmement_sockinfo(nominal):
     (output, dummy) = famp.communicate()
     family = int(output)
 
-    sock = socket.fromfd(fd, family, 0)
+    sock = socket.fromfd(actual, family, 0)
 
     print("[%s] %d sockinfo" % (tdonor.pid, there), end='')
     for f in (lambda: socket.AddressFamily(family).name,