Lines Matching defs:pty_fd
242 int pty_fd = -1; /* File descriptor of pty */
254 if (pty_fd != -1)
255 FD_SET(pty_fd, &fds);
308 if (!init && pty_fd != -1 && FD_ISSET(pty_fd, &fds))
315 if (pty_fd != -1 && FD_ISSET(pty_fd, &fds) && decaps_hdlc(pty_fd, encaps_gre, gre_fd) < 0) {
316 syslog(LOG_ERR, "CTRL: PTY read or GRE write failed (pty,gre)=(%d,%d)", pty_fd, gre_fd);
320 if (gre_fd != -1 && FD_ISSET(gre_fd, &fds) && decaps_gre(gre_fd, encaps_hdlc, pty_fd) < 0) {
321 if (gre_fd == 6 && pty_fd == 5) {
322 syslog(LOG_ERR, "CTRL: GRE-tunnel has collapsed (GRE read or PTY write failed (gre,pty)=(%d,%d))", gre_fd, pty_fd);
324 syslog(LOG_ERR, "CTRL: GRE read or PTY write failed (gre,pty)=(%d,%d)", gre_fd, pty_fd);
344 if (gre_fd != -1 || pty_fd != -1)
352 if (gre_fd == -1 || pty_fd == -1)
359 if (pty_fd != -1) {
360 FD_CLR(pty_fd, &fds);
361 close(pty_fd);
362 pty_fd = -1;
371 if (gre_fd != -1 || pty_fd != -1) {
378 if (pty_fd != -1) {
379 FD_CLR(pty_fd, &fds);
380 close(pty_fd);
381 pty_fd = -1;
392 pty_fd = startCall(pppaddrs, inetaddrs);
393 if (pty_fd > maxfd) maxfd = pty_fd;
394 if ((gre_fd = pptp_gre_init(call_id_pair, pty_fd, inetaddrs)) > maxfd)
447 if (pty_fd != -1)
448 close(pty_fd);
449 pty_fd = -1;
548 int pty_fd, tty_fd;
568 pty_fd = sockfd[1];
571 if (openpty(&pty_fd, &tty_fd, NULL, NULL, NULL) != 0) {
595 syslog(LOG_DEBUG, "CTRL: pty_fd = %d", pty_fd);
628 if (pty_fd > 1)
629 close(pty_fd);
643 return pty_fd;