Ignore:
Timestamp:
Aug 1, 2013, 6:30:31 PM (11 years ago)
Author:
Marek Kurdej
Message:

Major: changed plugins section name to plugings. Parameters section will be used for something else.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/src/PacpusLib/PacpusApplication.cpp

    r162 r165  
    99/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
    1010
     11#include <csignal>
    1112#include <Pacpus/kernel/Log.h>
    1213#include <Pacpus/kernel/PacpusApplication.h>
    1314#include <Pacpus/kernel/PacpusException.h>
     15#include <sstream>
     16#include <string>
    1417
    1518using namespace pacpus;
     
    2427    : QApplication(argc, argv, _internal)
    2528{
     29    //installSignalHandler();
    2630}
    2731
     
    9296    return false;
    9397}
     98
     99void signalHandler(int signal);
     100
     101void 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
     117void 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.