openbsd-ports/databases/redis/patches/patch-src_redis_c
dcoppa 13e8687552 - Update to redis-2.4.4
- Enable backtracing support using libexecinfo's backtrace()
- Add a rc script

rc_script diff from william@, who seems to have disappeared...
2011-11-29 16:07:23 +00:00

63 lines
1.7 KiB
Plaintext

$OpenBSD: patch-src_redis_c,v 1.4 2011/11/29 16:07:23 dcoppa Exp $
--- src/redis.c.orig Mon Nov 28 11:22:08 2011
+++ src/redis.c Tue Nov 29 16:27:51 2011
@@ -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>
@@ -1684,7 +1687,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;
@@ -1713,14 +1718,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;
@@ -1777,6 +1774,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);