chiark / gitweb /
allow tfd to override stderr/stdout
authorIan Jackson <ian@anarres>
Tue, 20 Feb 2007 19:54:00 +0000 (19:54 +0000)
committerIan Jackson <ian@anarres>
Tue, 20 Feb 2007 19:54:00 +0000 (19:54 +0000)
doc/README.virtualisation-server
virt-subproc/VirtSubproc.py

index 1bb776600ed12677b1b286ab547e0ccea4641b63..3c3835d5f7b81118ac25705f1068b1f0e19b9eee 100644 (file)
@@ -112,6 +112,9 @@ Protocol
                If this feature is available, execute-debug will
                be advertised.  Only one such plumbing is available.
 
+               <tfd> may be 1 or 2, in which case no output will
+               be written to the <stdout> or <stderr> files.
+
 * Commands
        copydown <host-tree> <testbed-path>
        copyup <testbed-tree> <host-path>
index 2c5e4f697df6367af3651d0db627d421ac358619..71b7725287c8c04b8d722100023355e3bafd3b5c 100644 (file)
@@ -158,11 +158,13 @@ def cmd_execute(c, ce):
                
        gobody = "      import sys\n"
        stdout = None
+       tfd = None
        if debug_g:
                (tfd,hfd) = m.groups()
                gobody += "     os.dup2(1,%d)\n" % int(tfd)
                stdout = int(hfd)
        for ioe in range(3):
+               if ioe == tfd: continue
                gobody += "     setfd(%d,'%s',%d)\n" % (
                        ioe, ce[ioe+2], ioe>0 )
        gobody += "     os.chdir(urllib.unquote('" + ce[5] +"'))\n"