pkgsrc/security/zoneminder/patches/patch-src_zm_signal_cpp
dsainty c01631c02e Patch up some Linux-specific assumptions in the code.
Fixes build under NetBSD.

Bump PKGREVISION for switch to ffmpeg2, and some portability changes that
aren't expected to affect functionality.
2015-04-10 02:58:49 +00:00

25 lines
898 B
Text

$NetBSD: patch-src_zm_signal_cpp,v 1.1 2015/04/10 02:58:49 dsainty Exp $
Don't assume machine-dependent IP register details are available for any
platform except Linux. Only Linux is sure to have this style of mcontext_t.
Resolves build on systems that have ucontext_t but an mcontext_t that
doesn't look like Linux.
--- src/zm_signal.cpp.orig 2015-04-09 19:15:46.423693213 +1200
+++ src/zm_signal.cpp 2015-04-09 19:18:25.475699808 +1200
@@ -66,10 +66,14 @@
ucontext_t *uc = (ucontext_t *) context;
#if defined(__x86_64__)
cr2 = info->si_addr;
+#if defined(__linux__)
ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]);
+#endif // defined(__linux__)
#else
cr2 = info->si_addr;
+#if defined(__linux__)
ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]);
+#endif // defined(__linux__)
#endif // defined(__x86_64__)
// Print the signal address and instruction pointer if available