aboutsummaryrefslogtreecommitdiff
path: root/common/log.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-12-21 20:42:08 -0500
committerDrew DeVault <sir@cmpwn.com>2015-12-21 20:42:08 -0500
commit91c102a897467ff1bae345458ccf096e32e7bd15 (patch)
tree104c612d08afef1566c9b56f962641bb39c0dc1b /common/log.c
parent5a13d19d4967cd90def4c29cd5ebfbaaa43bc1da (diff)
parentc3e9ee5e43c6d7adf6d5c9b74b39a5170cfe0b02 (diff)
Merge pull request #393 from robotanarchy/musl-libc-compatibility
musl libc compatibility
Diffstat (limited to 'common/log.c')
-rw-r--r--common/log.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/log.c b/common/log.c
index 02aac4c1..f9242bf4 100644
--- a/common/log.c
+++ b/common/log.c
@@ -10,7 +10,6 @@
#include <errno.h>
#include <string.h>
#include <stringop.h>
-#include <execinfo.h>
int colored = 1;
log_importance_t loglevel_default = L_ERROR;
@@ -137,6 +136,7 @@ bool _sway_assert(bool condition, const char* format, ...) {
}
void error_handler(int sig) {
+#if SWAY_Backtrace_FOUND
int i;
int max_lines = 20;
void *array[max_lines];
@@ -155,5 +155,8 @@ void error_handler(int sig) {
for (i = 0; (size_t)i < bt_len; i++) {
sway_log(L_ERROR, "Backtrace: %s", bt[i]);
}
+#else
+ sway_log(L_ERROR, "Error: Signal %d.", sig);
+#endif
exit(1);
}