Remove death handler if using musl

This commit is contained in:
Andrea Cavalli 2020-11-05 21:58:40 +01:00
parent d34a45ec83
commit 423d05f18e
6 changed files with 15 additions and 1 deletions

View File

@ -619,8 +619,10 @@ Client &Client::operator=(Client &&other) = default;
ClientManager::ClientManager() : impl_(std::make_unique<Impl>()) {
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
td::Log::set_disable_death_handler(true);
#endif
#endif
}
ClientManager::ClientId ClientManager::create_client() {

View File

@ -41,8 +41,10 @@
#include "td/utils/Time.h"
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
#include "td/utils/death_handler.h"
#endif
#endif
#ifndef USE_READLINE
#include "td/utils/find_boundary.h"

View File

@ -35,6 +35,7 @@
*/
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
#include "death_handler.h"
#include <assert.h>
@ -735,3 +736,4 @@ void DeathHandler::HandleSignal(int sig, void * /* info */, void *secret) {
} // namespace Debug
#endif
#endif

View File

@ -52,6 +52,7 @@
*/
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
#ifndef DEATH_HANDLER_H_
#define DEATH_HANDLER_H_
@ -262,3 +263,4 @@ class DeathHandler {
#endif // DEATH_HANDLER_H_
#endif
#endif

View File

@ -14,8 +14,10 @@
#include "td/utils/Time.h"
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
#include "td/utils/death_handler.h"
#endif
#endif
#include <atomic>
#include <cstdlib>
@ -293,7 +295,7 @@ void process_fatal_error(CSlice message) {
if (callback) {
callback(message);
}
#ifndef _WIN32
#ifndef _WIN32 && defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
#if TD_THREAD_UNSUPPORTED || TD_EVENTFD_UNSUPPORTED
std::abort();
#else

View File

@ -13,8 +13,10 @@
#include "td/telegram/Log.h"
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
#include "td/utils/death_handler.h"
#endif
#endif
#if TD_EMSCRIPTEN
#include <emscripten.h>
@ -22,9 +24,11 @@
int main(int argc, char **argv) {
#ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
td::Log::set_disable_death_handler(true);
Debug::DeathHandler dh;
#endif
#endif
td::init_openssl_threads();
td::TestsRunner &runner = td::TestsRunner::get_default();