| Re: [AD] [UNIX] signals and threads | 
[ Thread Index | 
Date Index
| More lists.liballeg.org/allegro-developers Archives
] 
On 2001-12-01, Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
> > Please test and commit.
> 
> Commited.
The following patch (related to the previous ones in this thread) was
committed.  This solves a problem with programs under X with sound
hanging when three finger saluted.
Index: src/x/xkeybd.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xkeybd.c,v
retrieving revision 1.8
diff -u -r1.8 xkeybd.c
--- src/x/xkeybd.c      2001/11/06 17:16:41     1.8
+++ src/x/xkeybd.c      2001/12/02 14:48:42
@@ -16,6 +16,10 @@
  */
 
 
+#include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+
 #include "allegro.h"
 #include "allegro/internal/aintern.h"
 #include "allegro/platform/aintunix.h"
@@ -55,6 +59,11 @@
 
 
 
+/* the pid to kill when three finger saluting */
+static int main_pid;
+
+
+
 /* _xwin_keydrv_set_leds:
  *  Updates the LED state.
  */
@@ -114,7 +123,7 @@
          _sigalrm_request_abort();
       else
 #endif
-         exit(EXIT_SUCCESS);
+         kill(main_pid, SIGTERM);
    }
 }
 
@@ -157,6 +166,8 @@
    _xwin_keyboard_focused = _xwin_keydrv_focused;
 
    XUNLOCK();
+
+   main_pid = getpid();
 
    return 0;
 }
 
- Messages sorted by: [ date | thread ]
- Prev by Date:
Re: [AD] CVS: allegro/include/allegro/platform al386gcc.h,1.2,1.3al386vc.h,1.2,1.3al386wat.h,1.2,1.3 alqnxcfg.h,1.4,1.5 alucfg.h,1.2,1.3
- Next by Date:
Re: [AD] [LNX] Mode-X and threads and mouse
- Previous by thread:
Re: [AD] [UNIX] signals and threads
- Next by thread:
Re: svgalib / beta two (was Re: [AD] install_allegro with NULL for atexit_ptr)