fix callPreviousSignalHandler()
authorAdam Simpkins <simpkins@fb.com>
Thu, 12 Dec 2013 21:46:01 +0000 (13:46 -0800)
committerJordan DeLong <jdelong@fb.com>
Fri, 20 Dec 2013 21:06:03 +0000 (13:06 -0800)
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

folly/experimental/symbolizer/SignalHandler.cpp

index 5eb014052e8582c6d86b647c9d3bac1c8af866b1..d19cc973ce9823989ad8ddde00cfd6d420e02c77 100644 (file)
@@ -110,6 +110,7 @@ void callPreviousSignalHandler(int signum) {
   for (auto p = kFatalSignals; p->name; ++p) {
     if (p->number == signum) {
       sigaction(signum, &p->oldAction, nullptr);
   for (auto p = kFatalSignals; p->name; ++p) {
     if (p->number == signum) {
       sigaction(signum, &p->oldAction, nullptr);
+      raise(signum);
       return;
     }
   }
       return;
     }
   }