antirez/redis — Issue #226: Build error on systems without backtracing support
Author: dcoppa
Created: 2011-12-01 16:25:37+00:00
State: open

Compilation fails on systems without backtracing support (like OpenBSD).

This is because the bugReportStart() function is in the wrong place. The diff below fixes the issue for me:

src/redis.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/redis.c b/src/redis.c
index b067b75..5238f4d 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -1886,6 +1886,14 @@ void redisAsciiArt(void) {
zfree(buf);
}

+void bugReportStart(void) {
+ if (server.bug_report_start == 0) {
+ redisLog(REDIS_WARNING,
+ "=== REDIS BUG REPORT START: Cut & paste starting from here ===");
+ server.bug_report_start = 1;
+ }
+}
+
#ifdef HAVE_BACKTRACE
static void *getMcontextEip(ucontext_t *uc) {
#if defined(__FreeBSD__)
@@ -1917,14 +1925,6 @@ static void *getMcontextEip(ucontext_t *uc) {
#endif
}

-void bugReportStart(void) {
- if (server.bug_report_start == 0) {
- redisLog(REDIS_WARNING,
- "=== REDIS BUG REPORT START: Cut & paste starting from here ===");
- server.bug_report_start = 1;
- }
-}
-
static void sigsegvHandler(int sig, siginfo_t *info, void *secret) {
void *trace[100];
char **messages = NULL;