Lines Matching defs:ttyfd
86 static int ttyfd = -1;
129 if (ttyfd != -1)
130 close(ttyfd);
131 if ((ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC)) < 0) {
136 (ttyfd = fcntl(i, F_DUPFD_CLOEXEC, 10)) < 0)
139 if (ttyfd < 10) {
144 if ((i = fcntl(ttyfd, F_DUPFD_CLOEXEC, 10)) < 0) {
145 close(ttyfd);
146 ttyfd = -1;
149 close(ttyfd);
150 ttyfd = i;
153 initialpgrp = tcgetpgrp(ttyfd);
168 tcsetpgrp(ttyfd, rootpid);
171 tcsetpgrp(ttyfd, initialpgrp);
172 close(ttyfd);
173 ttyfd = -1;
198 tcsetpgrp(ttyfd, pgrp);
834 if (tcsetpgrp(ttyfd, pgrp) < 0)
992 if (tcsetpgrp(ttyfd, rootpid) < 0)