summaryrefslogtreecommitdiff
path: root/src/mongo/util/signal_handlers_synchronous.cpp
diff options
context:
space:
mode:
authorJonathan Reams <jbreams@mongodb.com>2016-04-15 14:51:49 -0400
committerJonathan Reams <jbreams@mongodb.com>2016-04-16 15:19:01 -0400
commit1e42c8324b94f148d35297bdd0d6c47eeec0f1fc (patch)
treeee302bd8ee6ca641085b84b2afd4b59912da52df /src/mongo/util/signal_handlers_synchronous.cpp
parent63ea3e59a735b3fb6047e994c28834f841abccaa (diff)
downloadmongo-1e42c8324b94f148d35297bdd0d6c47eeec0f1fc.tar.gz
SERVER-23757 Clear signal mask when starting unit tests
Diffstat (limited to 'src/mongo/util/signal_handlers_synchronous.cpp')
-rw-r--r--src/mongo/util/signal_handlers_synchronous.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/util/signal_handlers_synchronous.cpp b/src/mongo/util/signal_handlers_synchronous.cpp
index c158224448c..fa383d97800 100644
--- a/src/mongo/util/signal_handlers_synchronous.cpp
+++ b/src/mongo/util/signal_handlers_synchronous.cpp
@@ -346,4 +346,13 @@ void reportOutOfMemoryErrorAndExit() {
writeMallocFreeStreamToLog();
quickExit(EXIT_ABRUPT);
}
+
+void clearSignalMask() {
+#ifndef _WIN32
+ // We need to make sure that all signals are unmasked so signals are handled correctly
+ sigset_t unblockSignalMask;
+ invariant(sigemptyset(&unblockSignalMask) == 0);
+ invariant(sigprocmask(SIG_SETMASK, &unblockSignalMask, nullptr) == 0);
+#endif
+}
} // namespace mongo