Commit c7c0266e authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

first stage: single letter variables

parent 8cabba69
...@@ -706,19 +706,19 @@ class Stream(mitogen.core.Stream): ...@@ -706,19 +706,19 @@ class Stream(mitogen.core.Stream):
def _first_stage(): def _first_stage():
import os,sys,zlib import os,sys,zlib
R,W=os.pipe() R,W=os.pipe()
R2,W2=os.pipe() r,w=os.pipe()
if os.fork(): if os.fork():
os.dup2(0,100) os.dup2(0,100)
os.dup2(R,0) os.dup2(R,0)
os.dup2(R2,101) os.dup2(r,101)
for f in R,R2,W,W2: os.close(f) for f in R,r,W,w:os.close(f)
os.environ['ARGV0'] = sys.executable os.environ['ARGV0']=e=sys.executable
os.execv(sys.executable,['mitogen:CONTEXT_NAME']) os.execv(e,['mitogen:CONTEXT_NAME'])
else: else:
os.write(1, 'EC0\n') os.write(1, 'EC0\n')
C = zlib.decompress(sys.stdin.read(input())) C = zlib.decompress(sys.stdin.read(input()))
os.fdopen(W,'w',0).write(C) os.fdopen(W,'w',0).write(C)
os.fdopen(W2,'w',0).write('%s\n%s' % (len(C),C)) os.fdopen(w,'w',0).write('%s\n%s'%(len(C),C))
os.write(1, 'EC1\n') os.write(1, 'EC1\n')
sys.exit(0) sys.exit(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment