29 lines
615 B
Diff
29 lines
615 B
Diff
--- a/src/util.c
|
|
+++ b/src/util.c
|
|
@@ -7,7 +7,9 @@
|
|
#include <uuid/uuid.h>
|
|
|
|
#include <errno.h>
|
|
+#ifdef __GLIBC__
|
|
#include <execinfo.h>
|
|
+#endif
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
@@ -79,12 +81,15 @@
|
|
int nptrs;
|
|
void *buffer[BT_BUF_SIZE];
|
|
|
|
+#ifdef __GLIBC__
|
|
nptrs = backtrace(buffer, BT_BUF_SIZE);
|
|
+#endif
|
|
fprintf(stderr, "\nOops! HTTPDirFS crashed! :(\n");
|
|
+#ifdef __GLIBC__
|
|
fprintf(stderr, "backtrace() returned the following %d addresses:\n",
|
|
nptrs);
|
|
backtrace_symbols_fd(buffer, nptrs, STDERR_FILENO);
|
|
-
|
|
+#endif
|
|
exit(EXIT_FAILURE);
|
|
}
|