]> rtime.felk.cvut.cz Git - sojka/sterm.git/commit
Handle hang-up event on stdin
authorMichal Sojka <michal.sojka@cvut.cz>
Thu, 12 Sep 2019 19:01:07 +0000 (21:01 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Thu, 12 Sep 2019 19:01:07 +0000 (21:01 +0200)
commitbf041a2c5d28692d919bbd0ce15a2cc4c2c85e41
treeb9f22649671dfd24f9b1cbc5eb3bac7fa4e1d467
parent2a989fa95fc9b5b67bc95b6db8a2cdabdf24f883
Handle hang-up event on stdin

When sterm is run with pipe as stdin rather than terminal, as is the
case, for example, with the following command:

     ssh somewhere sterm /dev/ttyS0

closing the pipe (e.g. killing ssh) does not send SIGHUP signal, but
POLLHUP event is reported by poll(). When this happened, sterm ended
up in an infinite loop, consuming 100% CPU. Now, we handle this event
and exit.
sterm.c