def _serve_process(self, slaveFd, serverPid):
self.serverPid = serverPid<EOL>if sys.stdin.isatty():<EOL><INDENT>self.oldTermios = termios.tcgetattr(sys.stdin.fileno())<EOL><DEDENT>else:<EOL><INDENT>self.oldTermios = None<EOL><DEDENT>self.oldStderr = SavedFile(<NUM_LIT:2>, sys, '<STR_LIT>')<EOL>self.oldStdout = SavedFile(<NUM_LIT:1>, sys, '<STR_LIT>')<EOL>self.oldStdin = SavedFile(<NUM_LIT:0>, sys, '<STR_LIT>')<EOL>self.oldStderr.save(slaveFd, mode="<STR_LIT:w>")<EOL>self.oldStdout.save(slaveFd, mode="<STR_LIT:w>")<EOL>self.oldStdin.save(slaveFd, mode="<STR_LIT:r>")<EOL>os.close(slaveFd)<EOL>self.closed = False<EOL>
Serves a process by connecting its outputs/inputs to the pty
slaveFd.  serverPid is the process controlling the master fd
that passes that output over the socket.