]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm tools: Fix broken terminal when kvm exits because of a signal
authorAnton Vorontsov <cbouatmailru@gmail.com>
Fri, 17 Jun 2011 16:10:46 +0000 (20:10 +0400)
committerPekka Enberg <penberg@kernel.org>
Fri, 17 Jun 2011 19:13:22 +0000 (22:13 +0300)
commit2a90e2940870c66a1d702ae87dadb851a79193cf
tree5298b72de3cc82cec8e1c630c1b8f1074316cea5
parent788a81e106afeefdcc5e122e4b1f7bbed676351b
kvm tools: Fix broken terminal when kvm exits because of a signal

Issuing 'killall kvm' leaves the terminal on which kvm was running in
a broken state. This is because atexit(3) handlers are not called if
a process terminates because of a signal.

Installing a proper handler for the TERM signal fixes the issue.

p.s. The rest of the kvm tools use signal(2), and not sigaction(2), so
     I continue the tradition.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/term.c