MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / set

Function set

src/OSspecific/POSIX/signals/sigInt.C:80–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
79
80void Foam::sigInt::set(const bool)
81{
82 if (oldAction_.sa_handler)
83 {
84 FatalErrorInFunction
85 << "Cannot call sigInt::set() more than once"
86 << abort(FatalError);
87 }
88
89 struct sigaction newAction;
90 newAction.sa_handler = sigHandler;
91 newAction.sa_flags = SA_NODEFER;
92 sigemptyset(&newAction.sa_mask);
93 if (sigaction(SIGINT, &newAction, &oldAction_) < 0)
94 {
95 FatalErrorInFunction
96 << "Cannot set SIGINT trapping"
97 << abort(FatalError);
98 }
99}
100
101
102// ************************************************************************* //

Callers

nothing calls this directly

Calls 2

sigactionClass · 0.70
abortFunction · 0.50

Tested by

no test coverage detected