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

index 8bcb467..34d91e6 100755 (executable)
@@ -138,22 +138,24 @@ def process_args():
                   callback=ocb_set_donor)
 
     args = sys.argv[1:]
-    last_nominal = None
+    last_nominal = None # None or (nominal,) ie None or (None,) or (int,)
 
     while True:
         (ov, args) = op.parse_args(args=args, values=ov)
         if not len(args): break
 
         arg = args.pop(0)
+        print("ARG %s" % arg, file=sys.stderr)
 
-        if donor is not None:
+        if donor is None:
+            print("SET_DONOR", file=sys.stderr)
             set_donor(int(arg))
         elif arg_matches(r'^(?:(\d+)=)?(\d+)?$'):
             (nominal, there) = m.groups()
             nominal = None if nominal is None else int(nominal)
             there = int(there)
             pending.append((nominal,there))
-            last_nominal = nominal
+            last_nominal = (nominal,)
         elif arg == 'exec':
             if not len(args):
                 op.error("exec needs command to run")
@@ -163,7 +165,7 @@ def process_args():
             if last_nominal is None:
                 op.error('sockinfo needs a prior fd spec')
             implement_pending()
-            implement_sockinfo(last_nominal)
+            implement_sockinfo(last_nominal[0])
         else:
             op.error("unknown argument/option `%s'" % arg)