Commits

Armin Rigo committed 1074bd7

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

Comments (0)

Files changed (1)

rpython/rtyper/module/ll_os.py

             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))