diff options
Diffstat (limited to 'networking/telnet.c')
-rw-r--r-- | networking/telnet.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/telnet.c b/networking/telnet.c index 77e1747..013d959 100644 --- a/networking/telnet.c +++ b/networking/telnet.c @@ -618,12 +618,12 @@ int telnet_main(int argc UNUSED_PARAM, char **argv) default: #ifdef USE_POLL - if (ufds[0].revents) /* well, should check POLLIN, but ... */ + if (ufds[0].revents & POLLIN) #else if (FD_ISSET(STDIN_FILENO, &rfds)) #endif { - len = read(STDIN_FILENO, G.buf, DATABUFSIZE); + len = safe_read(STDIN_FILENO, G.buf, DATABUFSIZE); if (len <= 0) doexit(EXIT_SUCCESS); TRACE(0, ("Read con: %d\n", len)); @@ -631,12 +631,12 @@ int telnet_main(int argc UNUSED_PARAM, char **argv) } #ifdef USE_POLL - if (ufds[1].revents) /* well, should check POLLIN, but ... */ + if (ufds[1].revents & POLLIN) #else if (FD_ISSET(netfd, &rfds)) #endif { - len = read(netfd, G.buf, DATABUFSIZE); + len = safe_read(netfd, G.buf, DATABUFSIZE); if (len <= 0) { write_str(1, "Connection closed by foreign host\r\n"); doexit(EXIT_FAILURE); |