Lines Matching refs:pty_master
152 static int pty_master; /* fd for master side of pty */ variable
635 pty_master = -1;
638 if (!get_pty(&pty_master, &pty_slave, ppp_devnam, uid)) {
739 if (device_script(ptycommand, pty_master, pty_master, 1,
743 (void) close(pty_master);
744 pty_master = -1;
974 if (pty_master >= 0)
975 (void) close(pty_master);
1958 if (pty_master > 2)
1959 (void) close(pty_master);
2608 (void) close(pty_master);
2609 pty_master = -1;
2708 flags = fcntl(pty_master, F_GETFL);
2710 || fcntl(pty_master, F_SETFL, flags | O_NONBLOCK) == -1)
2735 nfds = (ofd > pty_master? ofd: pty_master) + 1;
2746 while (nibuf != 0 || nobuf != 0 || ofd >= 0 || pty_master >= 0) {
2755 else if (pty_master >= 0)
2756 FD_SET(pty_master, &writey);
2766 if (pty_master >= 0 && ofd >= 0)
2767 FD_SET(pty_master, &ready);
2793 if (nibuf < 0 || pty_master == -1) {
2801 (void) close(pty_master);
2802 pty_master = -1;
2810 FD_SET(pty_master, &writey);
2817 if (ofd >= 0 && pty_master >= 0 && FD_ISSET(pty_master, &ready)) {
2819 nobuf = read(pty_master, obufp, sizeof(outpacket_buf));
2867 if (pty_master == -1)
2869 else if (FD_ISSET(pty_master, &writey)) {
2873 n = write(pty_master, ibufp, n);
2881 (void) close(pty_master);
2882 pty_master = -1;