summaryrefslogtreecommitdiffstats
path: root/CRT.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-12-05 15:43:56 +0000
committerHisham Muhammad <hisham@gobolinux.org>2010-12-05 15:43:56 +0000
commit36ef1a93be59addbb1d2ecf57083f74a3d2f9fe4 (patch)
treeca07fa51034658cbda5a4889a2ab549676eb97de /CRT.c
parent72dbb72b68f7bdc53aecb7648af75e848cec0251 (diff)
make htop friendly to uclibc (thanks to Matt for the report)
Diffstat (limited to 'CRT.c')
-rw-r--r--CRT.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/CRT.c b/CRT.c
index 14af4208..bf6afec2 100644
--- a/CRT.c
+++ b/CRT.c
@@ -11,7 +11,9 @@ in the source distribution for its full text.
#include <signal.h>
#include <stdlib.h>
#include <stdbool.h>
+#ifdef HAVE_EXECINFO_H
#include <execinfo.h>
+#endif
#include "String.h"
@@ -125,12 +127,14 @@ static void CRT_handleSIGSEGV(int sgn) {
CRT_done();
#if __linux
fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://htop.sf.net\n");
- #else
- fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
- #endif
+ #ifdef HAVE_EXECINFO_H
size_t size = backtrace(backtraceArray, sizeof(backtraceArray));
fprintf(stderr, "Backtrace: \n");
backtrace_symbols_fd(backtraceArray, size, 2);
+ #endif
+ #else
+ fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
+ #endif
abort();
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy