diff options
-rw-r--r-- | debuggerd/tombstoned/tombstoned.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/debuggerd/tombstoned/tombstoned.cpp b/debuggerd/tombstoned/tombstoned.cpp index 1fd96b81c..67545088d 100644 --- a/debuggerd/tombstoned/tombstoned.cpp +++ b/debuggerd/tombstoned/tombstoned.cpp @@ -34,6 +34,7 @@ #include <android-base/unique_fd.h> #include <cutils/sockets.h> +#include "debuggerd/handler.h" #include "debuggerd/protocol.h" #include "debuggerd/util.h" @@ -256,6 +257,14 @@ fail: int main(int, char* []) { umask(0137); + // Don't try to connect to ourselves if we crash. + struct sigaction action = {}; + action.sa_handler = [](int signal) { + LOG(ERROR) << "received fatal signal " << signal; + _exit(1); + }; + debuggerd_register_handlers(&action); + tombstone_directory_fd = open(kTombstoneDirectory, O_DIRECTORY | O_RDONLY | O_CLOEXEC); if (tombstone_directory_fd == -1) { PLOG(FATAL) << "failed to open tombstone directory"; |