Author: Armin Rigo <[email protected]>
Branch: release-2.1.x
Changeset: r66132:1074bd79c42c
Date: 2013-08-13 20:03 +0200
http://bitbucket.org/pypy/pypy/changeset/1074bd79c42c/

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

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
@@ -1643,6 +1643,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