Lines Matching refs:count

376 static size_t safe_write_double_iac(int fd, const char *buf, size_t count)  in safe_write_double_iac()  argument
383 if (count == 0) in safe_write_double_iac()
393 count--; in safe_write_double_iac()
397 IACptr = memchr(buf, IAC, count); in safe_write_double_iac()
398 wr = count; in safe_write_double_iac()
406 count -= rc; in safe_write_double_iac()
665 int count; in telnetd_main() local
802 count = select(G.maxfd + 1, &rdfdset, &wrfdset, NULL, tv_ptr); in telnetd_main()
804 if (count == 0) /* "telnetd -w SEC" timed out */ in telnetd_main()
806 if (count < 0) in telnetd_main()
838 count = safe_write_to_pty_decode_iac(ts); in telnetd_main()
839 if (count < 0) { in telnetd_main()
848 count = MIN(BUFSIZE - ts->wridx2, ts->size2); in telnetd_main()
849 count = safe_write_double_iac(ts->sockfd_write, (void*)(TS_BUF2(ts) + ts->wridx2), count); in telnetd_main()
850 if (count < 0) { in telnetd_main()
855 ts->wridx2 += count; in telnetd_main()
858 ts->size2 -= count; in telnetd_main()
868 count = MIN(BUFSIZE - ts->rdidx1, BUFSIZE - ts->size1); in telnetd_main()
869 count = safe_read(ts->sockfd_read, TS_BUF1(ts) + ts->rdidx1, count); in telnetd_main()
870 if (count <= 0) { in telnetd_main()
871 if (count < 0 && errno == EAGAIN) in telnetd_main()
876 if (!TS_BUF1(ts)[ts->rdidx1 + count - 1]) { in telnetd_main()
877 --count; in telnetd_main()
879 ts->size1 += count; in telnetd_main()
880 ts->rdidx1 += count; in telnetd_main()
889 count = MIN(BUFSIZE - ts->rdidx2, BUFSIZE - ts->size2); in telnetd_main()
890 count = safe_read(ts->ptyfd, TS_BUF2(ts) + ts->rdidx2, count); in telnetd_main()
891 if (count <= 0) { in telnetd_main()
892 if (count < 0) { in telnetd_main()
908 ts->size2 += count; in telnetd_main()
909 ts->rdidx2 += count; in telnetd_main()