[riot-commits] [RIOT-OS/RIOT] 369267: ethos: Avoid EOF loops on detached stdin

Gaëtan Harter hartergaetan at gmail.com
Fri Jan 26 18:20:08 CET 2018


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 369267863cca318b8daa13a9bc94c5327d036dae
      https://github.com/RIOT-OS/RIOT/commit/369267863cca318b8daa13a9bc94c5327d036dae
  Author: Joakim Nohlgård <joakim.nohlgard at eistec.se>
  Date:   2018-01-24 (Wed, 24 Jan 2018)

  Changed paths:
    M dist/tools/ethos/ethos.c

  Log Message:
  -----------
  ethos: Avoid EOF loops on detached stdin

Add a specific case of EOF on stdin to avoid situations where the
message `error reading from stdio. res=0` is repeated forever if stdin
is not a terminal. When ethos is started as a background process with
stdin redirected to /dev/null, e.g. `ethos ... < /dev/null &`, then
reading stdin will always result in a 0 length read (EOF).
If stdin is a tty we close the program on EOF (CTRL+D in the terminal),
otherwise, we stop reading from stdin after EOF was reached, but
continue tunneling traffic as usual.


  Commit: 63b3622ef61ee41758b251b908df1839a733db97
      https://github.com/RIOT-OS/RIOT/commit/63b3622ef61ee41758b251b908df1839a733db97
  Author: Gaëtan Harter <hartergaetan at gmail.com>
  Date:   2018-01-26 (Fri, 26 Jan 2018)

  Changed paths:
    M dist/tools/ethos/ethos.c

  Log Message:
  -----------
  Merge pull request #8426 from gebart/pr/ethos-eof

ethos: handle EOF on stdin


Compare: https://github.com/RIOT-OS/RIOT/compare/aaabbdd1d3b7...63b3622ef61e


More information about the commits mailing list