uterm: vt: handle HUP on controlling TTY
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 2 Dec 2012 11:02:06 +0000 (12:02 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sun, 2 Dec 2012 11:02:06 +0000 (12:02 +0100)
commit84a006777b0e18c1ffa49f3296534a7938c01b09
treec90aa81d5a0e859a6f73219e5704fedd01bc4117
parent653ceff5b00a8dd43e34e1e4a321a3e66a713c5e
uterm: vt: handle HUP on controlling TTY

If the controlling TTY (in our case the VT) signals us a HUP, we should
consider it closed and forward that to the caller. This does normally not
happen on real VTs, however, on fake-VTs this happens if the parent goes
away.

We forward the HUP to the controlling subsystem which then has to deal
with it. But more importantly, we disable the fd so we don't hog the CPU
by unconditionally flushing the queue.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/uterm.h
src/uterm_vt.c