Lines Matching defs:ttyfd
103 static int ttyfd = -1;
149 if (ttyfd == from)
150 ttyfd = to;
176 if (ttyfd != -1)
177 sh_close(ttyfd);
178 if ((ttyfd = open("/dev/tty", O_RDWR)) == -1) {
180 if (isatty(i) && (ttyfd = dup(i)) != -1)
186 ttyfd = to_upper_fd(ttyfd); /* Move to a high fd */
187 register_sh_fd(ttyfd, ttyfd_change);
192 if ((initialpgrp = tcgetpgrp(ttyfd)) < 0) {
204 if (ioctl(ttyfd, TIOCGETD, (char *)&ldisc) < 0
217 if (tcsetpgrp(ttyfd, rootpid) == -1)
224 if (tcsetpgrp(ttyfd, initialpgrp) == -1)
227 sh_close(ttyfd);
228 ttyfd = -1;
270 if (tcsetpgrp(ttyfd, jp->pgrp) == -1) {
615 if (mflag && gotpid != -1 && tcgetpgrp(ttyfd) != getpid()) {
616 if (tcsetpgrp(ttyfd, getpid()) == -1)
1407 if (tcsetpgrp(ttyfd, pgrp) == -1)
1480 if (tcsetpgrp(ttyfd, mypgrp) == -1)