Changeset 9157 in ntrip


Ignore:
Timestamp:
Oct 1, 2020, 7:53:24 AM (4 years ago)
Author:
stuerze
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bncmain.cpp

    r9143 r9157  
    5757using namespace std;
    5858
    59 void catch_signal(int) {
     59void catch_SIGINT(int) {
    6060  cout << "Program Interrupted by Ctrl-C" << endl;
    6161  BNC_CORE->sigintReceived = 1;
     
    6363  BNC_CORE->stopPPP();
    6464  qApp->quit();
     65}
     66
     67void catch_SIGPIPE(int signum) {
     68  cout << "Caught signal SIGPIPE " << signum << endl;
    6569}
    6670
     
    395399  bncGetThread*       getThread = 0;
    396400
    397   signal(SIGPIPE, SIG_IGN);
     401  signal(SIGPIPE, catch_SIGPIPE);
    398402
    399403  // Interactive Mode - open the main window
     
    455459  else {
    456460
    457     signal(SIGINT, catch_signal);
     461    signal(SIGINT, catch_SIGINT);
    458462
    459463    casterEph = new bncEphUploadCaster(); (void) casterEph;
Note: See TracChangeset for help on using the changeset viewer.