Changeset 165 in pacpusframework for branches/2.0-beta1/src/PacpusLib/PacpusApplication.cpp
- Timestamp:
- Aug 1, 2013, 6:30:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/src/PacpusLib/PacpusApplication.cpp
r162 r165 9 9 /// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved. 10 10 11 #include <csignal> 11 12 #include <Pacpus/kernel/Log.h> 12 13 #include <Pacpus/kernel/PacpusApplication.h> 13 14 #include <Pacpus/kernel/PacpusException.h> 15 #include <sstream> 16 #include <string> 14 17 15 18 using namespace pacpus; … … 24 27 : QApplication(argc, argv, _internal) 25 28 { 29 //installSignalHandler(); 26 30 } 27 31 … … 92 96 return false; 93 97 } 98 99 void signalHandler(int signal); 100 101 void PacpusApplication::installSignalHandler() 102 { 103 LOG_INFO("installing signal handler..."); 104 105 typedef void (*SignalHandlerType)(int); 106 107 //std::signal(SIGABRT, &signalHandler); 108 //std::signal(SIGFPE, &signalHandler); 109 //std::signal(SIGILL, &signalHandler); 110 std::signal(SIGINT, &signalHandler); // interrupt (CTRL-C) 111 //std::signal(SIGSEGV, &signalHandler); 112 //std::signal(SIGTERM, &signalHandler); 113 114 LOG_INFO("successfully installed signal handler"); 115 } 116 117 void signalHandler(int signal) 118 { 119 LOG_FATAL("signal received: sig = " << signal); 120 std::stringstream errorMessage; 121 errorMessage << "received signal number " << signal; 122 throw PacpusException(errorMessage.str()); 123 }
Note:
See TracChangeset
for help on using the changeset viewer.