33 struct sigaction Foam::sigIntImpl::oldAction_;
37 void Foam::sigIntImpl::sigIntHandler(int)
40 if (sigaction(SIGINT, &oldAction_, NULL) < 0)
44 "Foam::sigIntImpl::sigIntHandler()"
45 ) <<
"Cannot reset SIGINT trapping"
61 oldAction_.sa_handler = NULL;
70 if (sigaction(SIGINT, &oldAction_, NULL) < 0)
74 "Foam::sigIntImpl::~sigIntImpl()"
75 ) <<
"Cannot reset SIGINT trapping"
85 if (oldAction_.sa_handler)
89 "Foam::sigIntImpl::set()"
90 ) <<
"Cannot call sigIntImpl::set() more than once"
94 struct sigaction newAction;
95 newAction.sa_handler = sigIntHandler;
96 newAction.sa_flags = SA_NODEFER;
97 sigemptyset(&newAction.sa_mask);
98 if (sigaction(SIGINT, &newAction, &oldAction_) < 0)
102 "Foam::sigIntImpl::set()"
103 ) <<
"Cannot set SIGINT trapping"