certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/RTIA main.cc


From: CERTI CVS commits
Subject: [certi-cvs] certi/RTIA main.cc
Date: Fri, 27 Sep 2013 08:20:13 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      13/09/27 08:20:13

Modified files:
        RTIA           : main.cc 

Log message:
        Adjust RTIA signal handling in the same way RTIG does.
        This was suggested in
        bug #23135 : RTIG/RTIA generates no coredump after unhandled exception
        This close the bug.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/main.cc?cvsroot=certi&r1=3.28&r2=3.29

Patches:
Index: main.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/main.cc,v
retrieving revision 3.28
retrieving revision 3.29
diff -u -b -r3.28 -r3.29
--- main.cc     27 Feb 2010 16:53:36 -0000      3.28
+++ main.cc     27 Sep 2013 08:20:13 -0000      3.29
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: main.cc,v 3.28 2010/02/27 16:53:36 erk Exp $
+// $Id: main.cc,v 3.29 2013/09/27 08:20:13 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -27,16 +27,27 @@
 #include "RTIA_cmdline.h"
 
 #include <sys/types.h>
-#include <signal.h>
+#include <csignal>
 
 using namespace certi;
 using namespace rtia;
 using namespace std;
 
-extern "C"void SignalHandler(int Signal);
-void NewHandler();
 int normal_end;
 
+// ----------------------------------------------------------------------------
+void SignalHandler(int signal) {
+    printf("\nRTIA: Received signal %d. Exiting peacefully.\n", signal);
+    normal_end = 1;
+    // Catch signal again.
+    std::signal(signal, SignalHandler);
+}
+
+// ----------------------------------------------------------------------------
+void NewHandler() {
+    throw MemoryExhausted("RTIA (main) has exhausted memory error");
+}
+
 /**
  * @defgroup certi_executable_RTIA RTIA
  *
@@ -115,17 +126,5 @@
        return (EXIT_SUCCESS);
 }
 
-// ----------------------------------------------------------------------------
-void SignalHandler(int Signal) {
-
-       printf("\nRTIA: Received signal %d. Exiting peacefully.\n", Signal);
-        normal_end = 1;
-        //exit(0);
-}
-
-// ----------------------------------------------------------------------------
-void NewHandler() {
-       throw MemoryExhausted("RTIA has exhausted memory error");
-}
 
-// EOF $Id: main.cc,v 3.28 2010/02/27 16:53:36 erk Exp $
+// EOF



reply via email to

[Prev in Thread] Current Thread [Next in Thread]