Changeset 9154 in ntrip


Ignore:
Timestamp:
Sep 30, 2020, 9:34:25 PM (4 weeks ago)
Author:
stuerze
Message:

try to prevent an end of this program in case of SIGPIPE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmain.cpp

    r9151 r9154  
    5858using namespace std;
    5959
    60 void catch_signal(int) {
     60void catch_SIGINT(int) {
    6161  cout << "Program Interrupted by Ctrl-C" << endl;
    6262  BNC_CORE->sigintReceived = 1;
     
    6565  //sleep(1);
    6666  ::exit(0);
     67}
     68
     69void catch_SIGPIPE(int signum) {
     70  cout << "Caught signal SIGPIPE " << signum << endl;
    6771}
    6872
     
    421425  bncGetThread*       getThread = 0;
    422426
    423 
    424   signal(SIGPIPE, SIG_IGN);
    425 
     427  signal(SIGPIPE, catch_SIGPIPE);
    426428
    427429    // Interactive Mode - open the main window
     
    481483  else {
    482484
    483     signal(SIGINT, catch_signal);
     485    signal(SIGINT, catch_SIGINT);
    484486
    485487    BNC_CORE->sigintReceived = 0;
     
    494496    BNC_CORE->initCombination();
    495497
    496     //BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), &app, SLOT(quit()));
    497498    BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), app->instance(), SLOT(quit()));
    498499    BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);
Note: See TracChangeset for help on using the changeset viewer.