soc_term.py: write to stdout not stdin
The serv_conn() function should write the data read from the connection
to stdout, not stdin. Although stdin appears to work when soc_term is
invoked from a terminal in an interactive session, things get bad when
trying to redirect its output:
$ ./soc_term 54320 | tee nsec.log
<... make run etc. ...>
^C
$ file nsec.log
nsec.log: empty
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/soc_term.py b/soc_term.py
index c40362b..5178b60 100755
--- a/soc_term.py
+++ b/soc_term.py
@@ -99,7 +99,7 @@
buf = bytearray(data)
handle_telnet_codes(readyfd, buf)
if (readyfd == fd):
- to = sys.stdin.fileno()
+ to = sys.stdout.fileno()
else:
to = fd
except ConnectionResetError: