testdisplay: fix restoring termio at exit
authorImre Deak <imre.deak@intel.com>
Mon, 12 May 2014 10:29:49 +0000 (13:29 +0300)
committerImre Deak <imre.deak@intel.com>
Mon, 12 May 2014 10:36:40 +0000 (13:36 +0300)
commit63746417e25b8e9efbeb6021c768695740849a18
tree782b8ecd2b62f4a7d5b29d9fe3dda85c38cec8dc
parentd848a36545eec43760de7e34a57a796182358087
testdisplay: fix restoring termio at exit

At normal exit in test_all_modes we don't restore the original termio,
since g_io_channel_shutdown() closes the stdin fd and so the following
tcsetattr on stdin will fail. We also don't restore the termio at signal
exit. Fix both cases by installing an exit hanlder with a dup'ed stdin fd.

Signed-off-by: Imre Deak <imre.deak@intel.com>
tests/testdisplay.c