parent: Unroll os.close() loop in first stage

SSH command size: 469 (-11 bytes)
Preamble size: 8946 (no change)

Although the source is longer, the _compressed_ length is reduced.
wip-fakessh-exit-status
Alex Willmer 6 years ago committed by David Wilson
parent 85f36f4cb1
commit e051cf0ea0

@ -330,7 +330,10 @@ class Stream(mitogen.core.Stream):
os.dup2(0,100)
os.dup2(R,0)
os.dup2(r,101)
for f in R,r,W,w:os.close(f)
os.close(R)
os.close(r)
os.close(W)
os.close(w)
os.environ['ARGV0']=e=sys.executable
os.execv(e,['mitogen:CONTEXT_NAME'])
os.write(1,'EC0\n')

Loading…
Cancel
Save