Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h handlers.c session.c 


Log Message:
Fix more trouble during exit.

"Good" signals (HUP, INT, QUIT, ...) should exit by quitting the main
event loop.
"Evil" signals (ILL, FPE, SEGV, ...) should exit immediately, i.e.
not return from the signal handler.

===================================================================
RCS file: /cvs/e/e16/e/src/E.h,v
retrieving revision 1.598
retrieving revision 1.599
diff -u -3 -r1.598 -r1.599
--- E.h 21 Dec 2007 22:04:52 -0000      1.598
+++ E.h 30 Dec 2007 20:55:20 -0000      1.599
@@ -533,6 +533,7 @@
       char                xselect;
       char                exiting;
       char                in_signal_handler;
+      char                exit_now;
       char                save_ok;
       char                coredump;
       int                 exit_mode;
===================================================================
RCS file: /cvs/e/e16/e/src/handlers.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- handlers.c  2 Dec 2007 11:15:57 -0000       1.58
+++ handlers.c  30 Dec 2007 20:55:20 -0000      1.59
@@ -33,6 +33,7 @@
 {
    static int          loop_count = 0;
    int                 status;
+   const char         *txt;
 
    Mode.wm.in_signal_handler = 1;
 
@@ -60,62 +61,57 @@
        break;
 
      case SIGILL:
-       if (disp)
-          EUngrabServer();
-       DialogAlert(_
-                   ("Enlightenment performed an Illegal Instruction.\n" "\n"
-                    "This most likely is due to you having installed an run 
a\n"
-                    "binary of Enlightenment that was compiled for a make or 
model\n"
-                    "of CPU not 100%% identical or compatible with yours. 
Please\n"
-                    "either obtain the correct package for your system, or\n"
-                    "re-compile Enlightenment and possibly any support 
libraries\n"
-                    "that you got in binary format to run Enlightenment.\n"));
-       SessionExit(EEXIT_ERROR, NULL);
-       break;
+       txt = _("Enlightenment performed an Illegal Instruction.\n" "\n"
+               "This most likely is due to you having installed an run a\n"
+               "binary of Enlightenment that was compiled for a make or 
model\n"
+               "of CPU not 100%% identical or compatible with yours. Please\n"
+               "either obtain the correct package for your system, or\n"
+               "re-compile Enlightenment and possibly any support libraries\n"
+               "that you got in binary format to run Enlightenment.\n");
+       goto do_alert;
 
      case SIGFPE:
-       if (disp)
-          EUngrabServer();
-       DialogAlert(_
-                   ("Enlightenment caused a Floating Point Exception.\n" "\n"
-                    "This means that Enlightenment or support library routines 
it calls\n"
-                    "have performed an illegal mathematical operation (most 
likely\n"
-                    "dividing a number by zero). This is most likely a bug. It 
is\n"
-                    "recommended to restart now. If you wish to help fix this 
please\n"
-                    "compile Enlightenment with debugging symbols in and run\n"
-                    "Enlightenment under gdb so you can backtrace for where it 
died and\n"
-                    "send in a useful bug report with backtrace information 
and variable\n"
-                    "dumps etc.\n"));
-       SessionExit(EEXIT_ERROR, NULL);
-       break;
+       txt = _("Enlightenment caused a Floating Point Exception.\n" "\n"
+               "This means that Enlightenment or support library routines it 
calls\n"
+               "have performed an illegal mathematical operation (most 
likely\n"
+               "dividing a number by zero). This is most likely a bug. It is\n"
+               "recommended to restart now. If you wish to help fix this 
please\n"
+               "compile Enlightenment with debugging symbols in and run\n"
+               "Enlightenment under gdb so you can backtrace for where it died 
and\n"
+               "send in a useful bug report with backtrace information and 
variable\n"
+               "dumps etc.\n");
+       goto do_alert;
 
      case SIGSEGV:
+       txt = _("Enlightenment caused Segment Violation (Segfault)\n" "\n"
+               "This means that Enlightenment or support library routines it 
calls\n"
+               "have accessed areas of your system's memory that they are 
not\n"
+               "allowed access to. This is most likely a bug. It is 
recommended to\n"
+               "restart now. If you wish to help fix this please compile\n"
+               "Enlightenment with debugging symbols in and run 
Enlightenment\n"
+               "under gdb so you can backtrace for where it died and send in 
a\n"
+               "useful bug report with backtrace information and variable\n"
+               "dumps etc.\n");
+       goto do_alert;
+
+     case SIGBUS:
+       txt = _("Enlightenment caused Bus Error.\n" "\n"
+               "It is suggested you check your hardware and OS installation.\n"
+               "It is highly unusual to cause Bus Errors on operational\n"
+               "hardware.\n");
+       goto do_alert;
+
+      do_alert:
        if (loop_count > 0)
           abort();
        loop_count++;
-       if (disp)
-          EUngrabServer();
-       DialogAlert(_
-                   ("Enlightenment caused Segment Violation (Segfault)\n" "\n"
-                    "This means that Enlightenment or support library routines 
it calls\n"
-                    "have accessed areas of your system's memory that they are 
not\n"
-                    "allowed access to. This is most likely a bug. It is 
recommended to\n"
-                    "restart now. If you wish to help fix this please 
compile\n"
-                    "Enlightenment with debugging symbols in and run 
Enlightenment\n"
-                    "under gdb so you can backtrace for where it died and send 
in a\n"
-                    "useful bug report with backtrace information and 
variable\n"
-                    "dumps etc.\n"));
+#if 0                          /* Avoid X-ops? */
+       disp = NULL;
+#endif
+       Mode.wm.exit_now = 1;
+       DialogAlert(txt);
+       SessionExit(EEXIT_ERROR, NULL);
        abort();
-       break;
-
-     case SIGBUS:
-       if (disp)
-          EUngrabServer();
-       DialogAlert(_
-                   ("Enlightenment caused Bus Error.\n" "\n"
-                    "It is suggested you check your hardware and OS 
installation.\n"
-                    "It is highly unusual to cause Bus Errors on operational\n"
-                    "hardware.\n"));
        break;
 
      case SIGCHLD:
===================================================================
RCS file: /cvs/e/e16/e/src/session.c,v
retrieving revision 1.147
retrieving revision 1.148
diff -u -3 -r1.147 -r1.148
--- session.c   8 Dec 2007 14:01:27 -0000       1.147
+++ session.c   30 Dec 2007 20:55:20 -0000      1.148
@@ -680,7 +680,7 @@
    if (Mode.wm.exiting)
       return;
 
-   if (Mode.wm.startup || Mode.wm.in_signal_handler)
+   if (Mode.wm.startup || Mode.wm.exit_now)
       goto done;
 
    switch (mode)



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to