summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-11-09 11:06:30 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-11-09 11:06:30 (GMT)
commit3f63454e2258f8b187764066fca2cc2a9361b628 (patch)
tree14bfc812e6c73e853a608bf8b5d568bf120f6586
parent3ed5c2a277fcc2da2b52aa923e32d267e4be0dd5 (diff)
downloadcpython-3f63454e2258f8b187764066fca2cc2a9361b628.zip
cpython-3f63454e2258f8b187764066fca2cc2a9361b628.tar.gz
cpython-3f63454e2258f8b187764066fca2cc2a9361b628.tar.bz2
Patch #838546: Make terminal become controlling in pty.fork().
-rw-r--r--Lib/pty.py4
-rw-r--r--Misc/NEWS2
2 files changed, 6 insertions, 0 deletions
diff --git a/Lib/pty.py b/Lib/pty.py
index fae162d..889113c 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -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
diff --git a/Misc/NEWS b/Misc/NEWS
index 5c575c9..6753554 100644
--- 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.