* signal_init: Added SA_NODEFER to SIGINT.
authortwisti <none@none>
Thu, 6 Oct 2005 13:14:48 +0000 (13:14 +0000)
committertwisti <none@none>
Thu, 6 Oct 2005 13:14:48 +0000 (13:14 +0000)
* signal_handler_sigint: Check for cacao_exiting, so shutdown can be done
  immediately.

src/vm/signal.c

index ec8f6d6d0928d6e48069198e2045d1efbdc4bc05..e7e8c31b840205adf12a125e08b28a77175ef0a5 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: signal.c 3340 2005-10-04 20:19:37Z twisti $
+   $Id: signal.c 3378 2005-10-06 13:14:48Z twisti $
 
 */
 
@@ -107,7 +107,7 @@ void signal_init(void)
        /* catch SIGINT for exiting properly on <ctrl>-c */
 
        act.sa_sigaction = signal_handler_sigint;
-       act.sa_flags = SA_SIGINFO;
+       act.sa_flags = SA_NODEFER | SA_SIGINFO;
        sigaction(SIGINT, &act, NULL);
 
 
@@ -154,6 +154,11 @@ void signal_handler_sigquit(int sig, siginfo_t *siginfo, void *_p)
 
 void signal_handler_sigint(int sig, siginfo_t *siginfo, void *_p)
 {
+       /* if we are already in Runtime.exit(), just do it hardcore */
+
+       if (cacao_exiting)
+               exit(0);
+
        /* exit the vm properly */
 
        cacao_exit(0);