tools: libinput-debug-events stop variable needs volatile
authorPeter Seiderer <ps.report@gmx.net>
Tue, 13 Mar 2018 20:28:22 +0000 (21:28 +0100)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 14 Mar 2018 22:06:54 +0000 (08:06 +1000)
The stop variable set in the signal handler needs
volatile (and use the defined sig_atomic_t instead
of unsigned int).

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
tools/libinput-debug-events.c

index 33f51d0e32aa837bea975081b73164aead10f7d4..32782c210053b8afe60e4f5f4c2c9b45fc4deb21 100644 (file)
@@ -48,7 +48,7 @@ static const uint32_t screen_width = 100;
 static const uint32_t screen_height = 100;
 static struct tools_options options;
 static bool show_keycodes;
-static unsigned int stop = 0;
+static volatile sig_atomic_t stop = 0;
 static bool be_quiet = false;
 
 #define printq(...) ({ if (!be_quiet)  printf(__VA_ARGS__); })