Commit a4c67f33 authored by Adam Simpkins's avatar Adam Simpkins Committed by Jordan DeLong

fix callPreviousSignalHandler()

Summary:
If a previous handler was found, the code was missing the step of
actually re-raising the handler after restoring the old handler.

Test Plan: Verified that our service actually exits after receiving SIGTERM.

Reviewed By: tudorb@fb.com

FB internal diff: D1096360
parent 613bec48
...@@ -110,6 +110,7 @@ void callPreviousSignalHandler(int signum) { ...@@ -110,6 +110,7 @@ void callPreviousSignalHandler(int signum) {
for (auto p = kFatalSignals; p->name; ++p) { for (auto p = kFatalSignals; p->name; ++p) {
if (p->number == signum) { if (p->number == signum) {
sigaction(signum, &p->oldAction, nullptr); sigaction(signum, &p->oldAction, nullptr);
raise(signum);
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment