Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r66130:9445018c9ec4
Date: 2013-08-13 20:03 +0200
http://bitbucket.org/pypy/pypy/changeset/9445018c9ec4/

Log:    Initialize master_fd to -1 (like CPython) which is the value that
        will eventually be seen by the child.

diff --git a/rpython/rtyper/module/ll_os.py b/rpython/rtyper/module/ll_os.py
--- a/rpython/rtyper/module/ll_os.py
+++ b/rpython/rtyper/module/ll_os.py
@@ -1618,6 +1618,7 @@
             compilation_info=ExternalCompilationInfo(libraries=['util']))
         def forkpty_llimpl():
             master_p = lltype.malloc(rffi.INTP.TO, 1, flavor='raw')
+            master_p[0] = rffi.cast(rffi.INT, -1)
             opaqueaddr = rthread.gc_thread_before_fork()
             childpid = rffi.cast(lltype.Signed,
                                  os_forkpty(master_p, None, None, None))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to