def _setupChild(self, masterfd, slavefd):
        os.close(masterfd)
        os.setsid()
        fcntl.ioctl(slavefd, termios.TIOCSCTTY, '')

        for fd in range(3):
            if fd != slavefd:
                os.close(fd)

        os.dup2(slavefd, 0) # stdin
        os.dup2(slavefd, 1) # stdout
        os.dup2(slavefd, 2) # stderr

        for fd in _listOpenFDs():
            if fd > 2:
                try:
                    os.close(fd)
                except:
                    pass

        self._resetSignalDisposition()


    # PTYs do not have stdin/stdout/stderr. They only have in and out, just
    # like sockets. You cannot close one without closing off the entire PTY.
L{calcHA2} accepts the C{'md5'} algorithm and returns an MD5 hash of
dataset/ETHPy150Open twisted/twisted/twisted/internet/process.py/PTYProcess._setupChild--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_digestauth.py/DigestAuthTests.test_MD5HashA2Auth