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>()) { ClientManager::ClientManager() : impl_(std::make_unique<Impl>()) {
#ifndef _WIN32 #ifndef _WIN32
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
td::Log::set_disable_death_handler(true); td::Log::set_disable_death_handler(true);
#endif #endif
#endif
} }
ClientManager::ClientId ClientManager::create_client() { ClientManager::ClientId ClientManager::create_client() {

View File

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

View File

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

View File

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

View File

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

View File

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