You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/02/08 13:56:30 UTC
[incubator-nuttx-apps] branch pr52 updated: Shouldn't use local
readline in telnet
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch pr52
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
The following commit(s) were added to refs/heads/pr52 by this push:
new e2c7402 Shouldn't use local readline in telnet
e2c7402 is described below
commit e2c7402b131d7d66b778cfaa0d25a693eed78829
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Wed Feb 5 13:53:30 2020 +0800
Shouldn't use local readline in telnet
since the host has more powerful intelligent
Change-Id: Ia2d580f9d0b98dc52439fd7b5fe7217b3e17e29f
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
system/telnet/telnet_client.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/system/telnet/telnet_client.c b/system/telnet/telnet_client.c
index 04c17a7..eed0675 100644
--- a/system/telnet/telnet_client.c
+++ b/system/telnet/telnet_client.c
@@ -71,7 +71,6 @@
# include "zlib.h"
#endif
-#include "system/readline.h"
#include "netutils/telnetc.h"
/****************************************************************************
@@ -187,7 +186,7 @@ static void _event_handler(struct telnet_s *telnet,
/* Data received */
case TELNET_EV_DATA:
- printf("%.*s", (int)ev->data.size, ev->data.buffer);
+ fwrite(ev->data.buffer, 1, ev->data.size, stdout);
fflush(stdout);
break;
@@ -400,7 +399,7 @@ int main(int argc, FAR char *argv[])
/* Initialize poll descriptors */
memset(pfd, 0, sizeof(pfd));
- pfd[0].fd = 1;
+ pfd[0].fd = STDIN_FILENO;
pfd[0].events = POLLIN;
pfd[1].fd = sock;
pfd[1].events = POLLIN;
@@ -413,7 +412,7 @@ int main(int argc, FAR char *argv[])
if (pfd[0].revents & (POLLIN | POLLERR | POLLHUP))
{
- ret = std_readline(buffer, sizeof(buffer));
+ ret = read(STDIN_FILENO, buffer, sizeof(buffer));
if (ret > 0)
{
send_local_input(buffer, ret);