Skip to content

Commit

Permalink
Update tlcp_client.c
Browse files Browse the repository at this point in the history
  • Loading branch information
zxm256 authored Apr 20, 2024
1 parent 7b0d7d7 commit bd10fa3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/tlcp_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,21 @@ int tlcp_client_main(int argc, char *argv[])
FD_ZERO(&fds);
FD_SET(conn.sock, &fds);
if (read_stdin)
#ifdef WIN32
FD_SET(_fileno, &fds);
#else
FD_SET(STDIN_FILENO, &fds);

#endif
if (select(conn.sock + 1, &fds, NULL, NULL, NULL) < 0) {
fprintf(stderr, "%s: select error\n", prog);
goto end;
}

#ifdef WIN32
if (read_stdin && FD_ISSET(_fileno, &fds)) {
#else
if (read_stdin && FD_ISSET(STDIN_FILENO, &fds)) {
#endif

if (fgets(buf, sizeof(buf), stdin)) {
if (tls_send(&conn, (uint8_t *)buf, strlen(buf), &len) != 1) {
Expand Down

0 comments on commit bd10fa3

Please sign in to comment.