sherpa is hosted by Hepforge, IPPP Durham
close Warning: Can't synchronize with repository "(default)" (/hepforge/svn/sherpa does not appear to be a Subversion repository.). Look in the Trac log for more information.

Ticket #22: sigpipe.patch

File sigpipe.patch, 1.3 KB (added by Frank Siegert, 16 years ago)
  • SHERPA/Run/Main.C

     
    2828  std::set_unexpected(ATOOLS::Terminate);
    2929  signal(SIGSEGV,ATOOLS::SignalHandler);
    3030  signal(SIGINT,ATOOLS::SignalHandler);
     31  signal(SIGPIPE,ATOOLS::SignalHandler);
    3132  signal(SIGBUS,ATOOLS::SignalHandler);
    3233  signal(SIGFPE,ATOOLS::SignalHandler);
    3334  signal(SIGABRT,ATOOLS::SignalHandler);
  • ATOOLS/Org/Exception_Handler.C

     
    134134  bool modifiable=msg->Modifiable();
    135135  SetExitCode();
    136136  if ((m_signal!=SIGTERM && m_signal!=SIGINT &&
    137        m_signal!=SIGXCPU) &&
     137       m_signal!=SIGXCPU && m_signal!=SIGPIPE) &&
    138138      (m_exception==NULL ||
    139139       (m_exception->Type()!=ex::normal_exit &&
    140140        m_exception->Type()!=ex::missing_input))) {
     
    289289    m_exitcode=1;
    290290    Terminate();
    291291    break;
     292  case SIGPIPE:
     293    msg_Error()<<"   Pipe closed. Will stop writing."<<om::reset<<std::endl;
     294    m_exitcode=0;
     295    Terminate();
     296    break;
    292297  default:
    293298    msg_Error()<<"   Cannot handle signal."<<om::reset<<std::endl;
    294299    m_exitcode=1;