summaryrefslogtreecommitdiff
path: root/security/zoneminder/patches/patch-src_zm__rtp__source.cpp
diff options
context:
space:
mode:
authorgdt <gdt@pkgsrc.org>2018-07-13 02:05:11 +0000
committergdt <gdt@pkgsrc.org>2018-07-13 02:05:11 +0000
commitfbeed2928536441a685389bd34e71dc315d5ab94 (patch)
tree4553d4dddfa4d701d7c415956ae354255036a53c /security/zoneminder/patches/patch-src_zm__rtp__source.cpp
parent9f00b61232730a25d6c784df373172fff54550ea (diff)
downloadpkgsrc-fbeed2928536441a685389bd34e71dc315d5ab94.tar.gz
zoneminder: avoid %ld for time_t (int64_t, not long on arm)
zoneinder uses %ld to print tv.tv_sec, which is of type time_t. On NetBSD, that's int64_t, which happens to match long on amd64, but not on arm, and hence printf often segfaults. Kludge around this by casting to long, which should work for about 20 years, by which time a proper fix should have arrived in a zoneminder release. Not yet raised upstream, because our package is 1.28.1 and upstream has released 1.30.4.
Diffstat (limited to 'security/zoneminder/patches/patch-src_zm__rtp__source.cpp')
-rw-r--r--security/zoneminder/patches/patch-src_zm__rtp__source.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/security/zoneminder/patches/patch-src_zm__rtp__source.cpp b/security/zoneminder/patches/patch-src_zm__rtp__source.cpp
new file mode 100644
index 00000000000..a86236a1f9d
--- /dev/null
+++ b/security/zoneminder/patches/patch-src_zm__rtp__source.cpp
@@ -0,0 +1,24 @@
+$NetBSD: patch-src_zm__rtp__source.cpp,v 1.1 2018/07/13 02:05:11 gdt Exp $
+
+--- src/zm_rtp_source.cpp.orig 2015-02-05 02:52:37.000000000 +0000
++++ src/zm_rtp_source.cpp
+@@ -197,7 +197,7 @@ void RtpSource::updateRtcpData( uint32_t
+ {
+ struct timeval ntpTime = tvMake( ntpTimeSecs, suseconds_t((USEC_PER_SEC*(ntpTimeFrac>>16))/(1<<16)) );
+
+- Debug( 5, "ntpTime: %ld.%06ld, rtpTime: %x", ntpTime.tv_sec, ntpTime.tv_usec, rtpTime );
++ Debug( 5, "ntpTime: %ld.%06ld, rtpTime: %x", (long) ntpTime.tv_sec, ntpTime.tv_usec, rtpTime );
+
+ if ( mBaseTimeNtp.tv_sec == 0 )
+ {
+@@ -207,8 +207,8 @@ void RtpSource::updateRtcpData( uint32_t
+ }
+ else if ( !mRtpClock )
+ {
+- Debug( 5, "lastSrNtpTime: %ld.%06ld, rtpTime: %x", mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime );
+- Debug( 5, "ntpTime: %ld.%06ld, rtpTime: %x", ntpTime.tv_sec, ntpTime.tv_usec, rtpTime );
++ Debug( 5, "lastSrNtpTime: %ld.%06ld, rtpTime: %x", (long) mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime );
++ Debug( 5, "ntpTime: %ld.%06ld, rtpTime: %x", (long) ntpTime.tv_sec, ntpTime.tv_usec, rtpTime );
+
+ double diffNtpTime = tvDiffSec( mBaseTimeNtp, ntpTime );
+ uint32_t diffRtpTime = rtpTime - mBaseTimeRtp;