revision 621:225d147d2b43
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 621:225d147d2b43 |
parent | 620:d9b28f78b952 |
child | 622:3554650afb26 |
author | nkeynes |
date | Wed Jan 30 21:36:58 2008 +0000 (15 years ago) |
Tidy up watch flag handling
1.1 --- a/src/drivers/joy_linux.c Wed Jan 30 11:31:21 2008 +00001.2 +++ b/src/drivers/joy_linux.c Wed Jan 30 21:36:58 2008 +00001.3 @@ -240,23 +240,24 @@1.5 /*************************** dnotify support **********************/1.7 -static volatile gboolean need_input_rescan = FALSE;1.8 +static volatile int need_input_rescan = 0;1.9 static int watch_dir_fd;1.11 static gboolean gtk_loop_check_input(gpointer data)1.12 {1.13 - if( need_input_rescan ) {1.14 + if( need_input_rescan == 1 ) {1.15 + need_input_rescan = 0;1.16 int js = linux_joystick_scan();1.17 if( js > 0 ) {1.18 maple_reattach_all();1.19 }1.20 }1.21 - return TRUE;1.22 + return need_input_rescan != 2;1.23 }1.25 static void dnotify_handler(int sig )1.26 {1.27 - need_input_rescan = TRUE;1.28 + need_input_rescan = 1;1.29 }1.31 static gboolean linux_joystick_install_watch( const gchar *dir )1.32 @@ -280,4 +281,5 @@1.33 {1.34 signal( SIGRTMIN+1, SIG_IGN );1.35 close( watch_dir_fd );1.36 + need_input_rescan = 2;1.37 }
.