From: Adam Simpkins Date: Thu, 12 Dec 2013 21:46:01 +0000 (-0800) Subject: fix callPreviousSignalHandler() X-Git-Tag: v0.22.0~761 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=a4c67f338d61bf5aaec3ac5cab4371697deaa2b4 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 --- diff --git a/folly/experimental/symbolizer/SignalHandler.cpp b/folly/experimental/symbolizer/SignalHandler.cpp index 5eb01405..d19cc973 100644 --- a/folly/experimental/symbolizer/SignalHandler.cpp +++ b/folly/experimental/symbolizer/SignalHandler.cpp @@ -110,6 +110,7 @@ void callPreviousSignalHandler(int signum) { for (auto p = kFatalSignals; p->name; ++p) { if (p->number == signum) { sigaction(signum, &p->oldAction, nullptr); + raise(signum); return; } }