summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2009-10-30 18:07:22 +0100
committerJohannes Schindelin <johannes.schindelin@gmx.de>2009-10-30 18:29:11 +0100
commit7ed1c0aeac12fc7078013d0cb57ae40e6ee934d6 (patch)
treec8e00b9b0488d40b4a764ad81fe86e7e6793bc56
parent1f6c5609851f3431f14c275a5e1d3c4900a63baa (diff)
downloadlibvncserver-7ed1c0aeac12fc7078013d0cb57ae40e6ee934d6.zip
libvncserver-7ed1c0aeac12fc7078013d0cb57ae40e6ee934d6.tar.gz
SDLvncviewer: add SIGINT handler to be able to actually stop program.
Signed-off-by: Christian Beier <dontmind@freeshell.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--client_examples/SDLvncviewer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/client_examples/SDLvncviewer.c b/client_examples/SDLvncviewer.c
index c8c63d1..5555cd1 100644
--- a/client_examples/SDLvncviewer.c
+++ b/client_examples/SDLvncviewer.c
@@ -1,4 +1,5 @@
#include <SDL.h>
+#include <signal.h>
#include <rfb/rfbclient.h>
#include "scrap.h"
@@ -498,6 +499,7 @@ int main(int argc,char** argv) {
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY,
SDL_DEFAULT_REPEAT_INTERVAL);
atexit(SDL_Quit);
+ signal(SIGINT, exit);
do {
/* 16-bit: cl=rfbGetClient(5,3,2); */
OpenPOWER on IntegriCloud