openbsd-ports/databases/redis/patches/patch-src_redis_c
2012-03-19 09:27:36 +00:00

72 lines
2.2 KiB
Plaintext

$OpenBSD: patch-src_redis_c,v 1.8 2012/03/19 09:27:36 dcoppa Exp $
--- src/redis.c.orig Sun Mar 18 22:14:28 2012
+++ src/redis.c Mon Mar 19 10:19:36 2012
@@ -33,7 +33,9 @@
#ifdef HAVE_BACKTRACE
#include <execinfo.h>
+ #ifndef __OpenBSD__
#include <ucontext.h>
+ #endif
#endif /* HAVE_BACKTRACE */
#include <time.h>
@@ -43,6 +45,7 @@
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -1806,7 +1809,9 @@ int main(int argc, char **argv) {
#ifdef HAVE_BACKTRACE
static void *getMcontextEip(ucontext_t *uc) {
-#if defined(__FreeBSD__)
+#if defined(__OpenBSD__)
+ return NULL;
+#elif defined(__FreeBSD__)
return (void*) uc->uc_mcontext.mc_eip;
#elif defined(__dietlibc__)
return (void*) uc->uc_mcontext.eip;
@@ -1835,14 +1840,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;
@@ -1918,7 +1915,7 @@ static void sigsegvHandler(int sig, siginfo_t *info, v
"=== REDIS BUG REPORT END. Make sure to include from START to END. ===\n\n"
" Please report the crash opening an issue on github:\n\n"
" http://github.com/antirez/redis/issues\n\n"
-" Suspect RAM error? Use redis-server --test-memory to veryfy it.\n\n"
+" Suspect RAM error? Use redis-server --test-memory to verify it.\n\n"
);
/* free(messages); Don't call free() with possibly corrupted memory. */
if (server.daemonize) unlink(server.pidfile);
@@ -1934,6 +1931,14 @@ static void sigsegvHandler(int sig, siginfo_t *info, v
kill(getpid(),sig);
}
#endif /* HAVE_BACKTRACE */
+
+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 sigtermHandler(int sig) {
REDIS_NOTUSED(sig);