MCPcopy Create free account
hub / github.com/apache/mesos / handler

Function handler

src/logging/logging.cpp:95–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93// it should work in 'most' cases in signal handlers.
94#ifndef __WINDOWS__
95inline void handler(int signal, siginfo_t *siginfo, void *context)
96{
97 if (signal == SIGTERM) {
98 if (siginfo->si_code == SI_USER ||
99 siginfo->si_code == SI_QUEUE ||
100 siginfo->si_code <= 0) {
101 RAW_LOG(WARNING, "Received signal SIGTERM from process %d of user %d; "
102 "exiting", siginfo->si_pid, siginfo->si_uid);
103 } else {
104 RAW_LOG(WARNING, "Received signal SIGTERM; exiting");
105 }
106
107 // Setup the default handler for SIGTERM so that we don't print
108 // a stack trace.
109 os::signals::reset(signal);
110 raise(signal);
111 } else {
112 RAW_LOG(FATAL, "Unexpected signal in signal handler: %d", signal);
113 }
114}
115#endif // __WINDOWS__
116
117

Callers 2

handleMethod · 0.85
TEST_FFunction · 0.85

Calls 1

resetFunction · 0.85

Tested by 1

TEST_FFunction · 0.68