Call tcgetattr and tcsetattr on the slave end of the pty in order to avoid an "invali...
authorZac Medico <zmedico@gentoo.org>
Fri, 25 May 2007 20:22:53 +0000 (20:22 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 25 May 2007 20:22:53 +0000 (20:22 -0000)
svn path=/main/trunk/; revision=6625

pym/portage/__init__.py

index bc48de8a1f022310ebe41420a81f2608212a757e..813b4f27f5b20043d3d2081caf57bc6a97d74b1a 100644 (file)
@@ -2284,9 +2284,9 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, **keyw
                # Disable the ECHO attribute so the terminal behaves properly
                # if the subprocess needs to read input from stdin.
                import termios
-               term_attr = termios.tcgetattr(master_fd)
+               term_attr = termios.tcgetattr(slave_fd)
                term_attr[3] &= ~termios.ECHO
-               termios.tcsetattr(master_fd, termios.TCSAFLUSH, term_attr)
+               termios.tcsetattr(slave_fd, termios.TCSAFLUSH, term_attr)
                # tee will always exit with an IO error, so ignore it's stderr.
                null_file = open('/dev/null', 'w')
                mypids.extend(portage.process.spawn(['tee', '-i', '-a', logfile],