]> granicus.if.org Git - python/commitdiff
Patch #838546: Make terminal become controlling in pty.fork().
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 9 Nov 2006 11:06:30 +0000 (11:06 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 9 Nov 2006 11:06:30 +0000 (11:06 +0000)
Lib/pty.py
Misc/NEWS

index fae162dc487509c909db8b477dc6fa93f443c8d0..889113c3dd57b975b493b7ee02323687edac38cf 100644 (file)
@@ -118,6 +118,10 @@ def fork():
         if (slave_fd > STDERR_FILENO):
             os.close (slave_fd)
 
+        # Explicitly open the tty to make it become a controlling tty.
+        tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
+        os.close(tmp_fd)
+
     # Parent and child process.
     return pid, master_fd
 
index 5c575c974732d96e503edd09edaa3228701bb1d3..6753554ea3d61507665140b3fb326a6c2d0fe27f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -70,6 +70,8 @@ Core and builtins
 Extension Modules
 -----------------
 
+- Patch #838546: Make terminal become controlling in pty.fork()
+
 - Patch #1560695: Add .note.GNU-stack to ctypes' sysv.S so that
   ctypes isn't considered as requiring executable stacks.