pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

zoneminder: Merge patches from 1.32



Module Name:	pkgsrc-wip
Committed By:	Greg Troxel <gdt%lexort.com@localhost>
Pushed By:	gdt
Date:		Sun Jan 14 14:09:06 2024 -0500
Changeset:	0fe9bfc1ba5d208f2f9baa1433f5e9a9015a5577

Modified Files:
	zoneminder/Makefile
	zoneminder/distinfo
	zoneminder/patches/patch-CMakeLists.txt
	zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm
	zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm
	zoneminder/patches/patch-src_zm__event.cpp
	zoneminder/patches/patch-src_zm__eventstream.cpp
	zoneminder/patches/patch-src_zm__monitor.cpp
	zoneminder/patches/patch-src_zm__rtp__ctrl.h
	zoneminder/patches/patch-src_zm__rtp__source.cpp
	zoneminder/patches/patch-src_zm__utils.cpp
	zoneminder/patches/patch-src_zm_comms_h
	zoneminder/patches/patch-src_zm_logger_cpp
	zoneminder/patches/patch-src_zm_remote_camera_h
	zoneminder/patches/patch-src_zmu.cpp
Removed Files:
	zoneminder/patches/patch-cmake_Modules_Pod2Man.cmake
	zoneminder/patches/patch-src_zm_comms_cpp
	zoneminder/patches/patch-src_zmc_cpp

Log Message:
zoneminder: Merge patches from 1.32

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0fe9bfc1ba5d208f2f9baa1433f5e9a9015a5577

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 zoneminder/Makefile                                |  3 +
 zoneminder/distinfo                                | 29 +++----
 zoneminder/patches/patch-CMakeLists.txt            | 35 ++++----
 .../patches/patch-cmake_Modules_Pod2Man.cmake      | 19 -----
 ...ch-scripts_ZoneMinder_lib_ZoneMinder_General_pm | 18 ++--
 ...ipts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm | 15 ++--
 zoneminder/patches/patch-src_zm__event.cpp         | 99 +++++++++-------------
 zoneminder/patches/patch-src_zm__eventstream.cpp   | 25 +++---
 zoneminder/patches/patch-src_zm__monitor.cpp       | 44 +++++-----
 zoneminder/patches/patch-src_zm__rtp__ctrl.h       | 11 ---
 zoneminder/patches/patch-src_zm__rtp__source.cpp   | 35 ++++----
 zoneminder/patches/patch-src_zm__utils.cpp         | 37 +++-----
 zoneminder/patches/patch-src_zm_comms_cpp          | 17 ----
 zoneminder/patches/patch-src_zm_comms_h            | 25 +++---
 zoneminder/patches/patch-src_zm_logger_cpp         | 33 ++++----
 zoneminder/patches/patch-src_zm_remote_camera_h    | 17 ++--
 zoneminder/patches/patch-src_zmc_cpp               | 25 ------
 zoneminder/patches/patch-src_zmu.cpp               | 48 +++++------
 18 files changed, 211 insertions(+), 324 deletions(-)

diffs:
diff --git a/zoneminder/Makefile b/zoneminder/Makefile
index f028336791..ef79627f15 100644
--- a/zoneminder/Makefile
+++ b/zoneminder/Makefile
@@ -46,6 +46,9 @@ USE_TOOLS+=	gmake perl pkg-config
 CMAKE_ARGS+=	-DCMAKE_VERBOSE_MAKEFILE=true
 CMAKE_ARGS+=	-DCMAKE_BUILD_TYPE=Debug
 
+# \todo Necesary? Correct?
+CMAKE_ARGS+=	-DMANPAGE_DEST_PREFIX=${PKGMANDIR}
+
 ## PATHS
 
 # zoneminder has a dizzying array of variables for various paths.
diff --git a/zoneminder/distinfo b/zoneminder/distinfo
index 1896fc058c..4adaf13f7c 100644
--- a/zoneminder/distinfo
+++ b/zoneminder/distinfo
@@ -9,23 +9,20 @@ Size (ZoneMinder-1.36.33.tar.gz) = 11501221 bytes
 BLAKE2s (ZoneMinder-CakePHP-Enum-Behavior-master.tar.gz) = 618af60eff56f659a700ff3bc9a3721c1b5a1ba8d15bc2a4213a4022297553bc
 SHA512 (ZoneMinder-CakePHP-Enum-Behavior-master.tar.gz) = fa51aa34749cf0e7c9c484c4d65718696230291780df1bac9a5ca8144a230d5cdfdf2ff2fae413248a09ddd14615dbe88b111713e11173aa9d9078c5b3c9064c
 Size (ZoneMinder-CakePHP-Enum-Behavior-master.tar.gz) = 3506 bytes
-SHA1 (patch-CMakeLists.txt) = cfc565e597d48c6b3c54e1aba53e5f1b4e19f34a
-SHA1 (patch-cmake_Modules_Pod2Man.cmake) = f0a1462037fc63fa9f35d0595f4f50946f5518e7
+SHA1 (patch-CMakeLists.txt) = dca040058ec7b389474dff9853c46f65fd5626da
 SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_ConfigData.pm.in) = 3bf4e5e8276a682695db640e6608dd14c7315320
-SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm) = 84a1db650e90aa8e4dfe4c7633f1e5b41022fd01
-SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm) = b97c104f6ac102fc4510eb0977169375cdd97197
+SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm) = 996670d8a659c0624587da73f8083d9349aaa1ba
+SHA1 (patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm) = b3de55618915fad3d9263954db71270c800ad6f1
 SHA1 (patch-scripts_zm_in) = a05727261bb8be6b707e9a14ae4ff52ea3770d51
 SHA1 (patch-scripts_zmpkg_pl_in) = eb3166ae3cd9bb0ce1b828b64722506aa4e82368
-SHA1 (patch-src_zm__event.cpp) = ba65b91fd62c2840819a71b23ffdae87b0ebe487
-SHA1 (patch-src_zm__eventstream.cpp) = 63040024a69c9362e544e8950da57d831824f2f8
-SHA1 (patch-src_zm__monitor.cpp) = 5611aa37187bc9910ba1ccd9ddd5d0f421438b53
-SHA1 (patch-src_zm__rtp__ctrl.h) = 4e0fd8e80932de8d77b3386a356cc026ddc23113
-SHA1 (patch-src_zm__rtp__source.cpp) = 2488ae3655f529a71d8b98fa29a9e0435bbdf182
-SHA1 (patch-src_zm__utils.cpp) = 0326a092f441a481975548a73d0c8f7af1fc702c
-SHA1 (patch-src_zm_comms_cpp) = bd3c3e6dd4d11ea0845d2da662e99169cd6e6680
-SHA1 (patch-src_zm_comms_h) = e9e25dced4ad54aa118f153fbd3390d1eb525e65
-SHA1 (patch-src_zm_logger_cpp) = aed07139cd8adc11c7b43d4fefc24bc158b5617c
-SHA1 (patch-src_zm_remote_camera_h) = 87da3e6326df5f9ab3c98fed5c7c9bae20cd6dc5
+SHA1 (patch-src_zm__event.cpp) = 2831f586f140f682dd107a1adb09531c388a1df8
+SHA1 (patch-src_zm__eventstream.cpp) = d2134edf09f142a6a545ca36d3263b13defcadd6
+SHA1 (patch-src_zm__monitor.cpp) = ac6eb821d5d72455b46165e74ea1d321faf9e431
+SHA1 (patch-src_zm__rtp__ctrl.h) = c0cd9358f63a7eee495db46d07fd3e130616fd62
+SHA1 (patch-src_zm__rtp__source.cpp) = 288b32cff869103b04e96487b92bb12533b29772
+SHA1 (patch-src_zm__utils.cpp) = ba2d2a976f678a590b8895acf05079f619c7a9be
+SHA1 (patch-src_zm_comms_h) = b0fc917e2d54913f96623b723ee32b6e09361722
+SHA1 (patch-src_zm_logger_cpp) = 1d3d2a6baef1abe762ede06aaf393e5bc2e2080e
+SHA1 (patch-src_zm_remote_camera_h) = 2f774924338b9e42e7bcaa1701af72861ea62c22
 SHA1 (patch-src_zm_signal_cpp) = af9625702518648b8d62ed20d0d52c1a2a27841a
-SHA1 (patch-src_zmc_cpp) = 1499eb3e2d92372a0dea036f22f429efeefe4d95
-SHA1 (patch-src_zmu.cpp) = c2097766ecd0707728d29353ffaf590b234d8902
+SHA1 (patch-src_zmu.cpp) = e5d92c9aa17c3a9e8b53c2cbd43712d80c76ab4e
diff --git a/zoneminder/patches/patch-CMakeLists.txt b/zoneminder/patches/patch-CMakeLists.txt
index e8bed1eadc..4f26e10143 100644
--- a/zoneminder/patches/patch-CMakeLists.txt
+++ b/zoneminder/patches/patch-CMakeLists.txt
@@ -12,18 +12,18 @@ exist, so don't insist on librt being present.  Fixes the build on MacOS.
 Let Pkgsrc be responsible for zm.conf into examples, rather than overwriting
 the existing configuration file.
 
---- CMakeLists.txt.orig	2018-12-08 14:22:36.000000000 +0000
+--- CMakeLists.txt.orig	2023-02-23 21:44:01.000000000 +0000
 +++ CMakeLists.txt
 @@ -4,7 +4,7 @@
  #
- cmake_minimum_required (VERSION 2.8.7)
- project (zoneminder)
--file (STRINGS "version" zoneminder_VERSION)
-+file (STRINGS "version.txt" zoneminder_VERSION)
+ cmake_minimum_required(VERSION 3.5.0)
+ project(zoneminder)
+-file(STRINGS "version" zoneminder_VERSION)
++file(STRINGS "version.txt" zoneminder_VERSION)
  # make API version a minor of ZM version
  set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
  
-@@ -282,7 +282,9 @@ check_include_file("ucontext.h" HAVE_UCO
+@@ -267,7 +267,9 @@ check_include_file("ucontext.h" HAVE_UCO
  check_include_file("sys/sendfile.h" HAVE_SYS_SENDFILE_H)
  check_include_file("sys/syscall.h" HAVE_SYS_SYSCALL_H)
  check_function_exists("syscall" HAVE_SYSCALL)
@@ -33,17 +33,18 @@ the existing configuration file.
  check_function_exists("posix_memalign" HAVE_POSIX_MEMALIGN)
  check_type_size("siginfo_t" HAVE_SIGINFO_T)
  check_type_size("ucontext_t" HAVE_UCONTEXT_T)
-@@ -293,7 +295,7 @@ if (UNIX)
-     include (CheckLibraryExists)
-     CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
-     if(NOT HAVE_CLOCK_GETTIME)
--        message(FATAL_ERROR "clock_gettime not found")
-+        #message(FATAL_ERROR "clock_gettime not found")
-     else(NOT HAVE_CLOCK_GETTIME)
-         list(APPEND ZM_BIN_LIBS "-lrt")
-     endif(NOT HAVE_CLOCK_GETTIME)
-@@ -891,8 +893,8 @@ else(zmconfgen_result EQUAL 0)
- endif(zmconfgen_result EQUAL 0)
+@@ -278,7 +280,8 @@ if(UNIX)
+   include(CheckLibraryExists)
+   CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
+   if(NOT HAVE_CLOCK_GETTIME)
+-    message(FATAL_ERROR "clock_gettime not found")
++    # \todo Explain why just skipping this is ok.
++    #message(FATAL_ERROR "clock_gettime not found")
+   else()
+     list(APPEND ZM_BIN_LIBS "-lrt")
+   endif()
+@@ -863,8 +866,8 @@ else()
+ endif()
  
  # Install zm.conf
 -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/zm.conf" DESTINATION "${ZM_CONFIG_DIR}")
diff --git a/zoneminder/patches/patch-cmake_Modules_Pod2Man.cmake b/zoneminder/patches/patch-cmake_Modules_Pod2Man.cmake
deleted file mode 100644
index d31827f8a4..0000000000
--- a/zoneminder/patches/patch-cmake_Modules_Pod2Man.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD$
-
-Change man install path to pkgsrc norms.
-
-Not reported upstream until we are caught up.  Then, the bug is not
-the value, but that it isn't configurable via a cmake command-line
-argument.
-
---- cmake/Modules/Pod2Man.cmake.orig	2019-02-22 15:38:47.000000000 +0000
-+++ cmake/Modules/Pod2Man.cmake
-@@ -58,7 +58,7 @@ MACRO(POD2MAN PODFILE MANFILE SECTION)
- 
- 	INSTALL(
- 		FILES ${CMAKE_CURRENT_BINARY_DIR}/${MANFILE}.${SECTION}.gz
--		DESTINATION share/man/man${SECTION}
-+		DESTINATION man/man${SECTION}
-     	)
- ENDMACRO(POD2MAN PODFILE MANFILE SECTION)
- 
diff --git a/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm b/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm
index c33e2c7318..eab799f75d 100644
--- a/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm
+++ b/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_General_pm
@@ -19,14 +19,14 @@ installed on the system, or not in the $PATH.
 
 Use the -m parameter to su, as ZM_WEB_USER shouldn't require a login shell.
 
---- scripts/ZoneMinder/lib/ZoneMinder/General.pm.orig	2018-12-08 14:22:36.000000000 +0000
+--- scripts/ZoneMinder/lib/ZoneMinder/General.pm.orig	2023-02-23 21:44:01.000000000 +0000
 +++ scripts/ZoneMinder/lib/ZoneMinder/General.pm
-@@ -104,7 +104,7 @@ sub getCmdFormat {
-       chomp($output);
-       Debug("Test failed, '$output'");
+@@ -92,7 +92,7 @@ sub getCmdFormat {
+     chomp( $output );
+     Debug("Test failed, '$output'");
  
--      $prefix = "su ".$Config{ZM_WEB_USER}." -c '";
-+      $prefix = "su -m ".$Config{ZM_WEB_USER}." -c '";
-       $suffix = "'";
-       $command = $prefix.$null_command.$suffix;
-       Debug("Testing \"$command\"");
+-    $prefix = 'su '.$Config{ZM_WEB_USER}.q` --shell=/bin/sh --command='`;
++    $prefix = 'su -m'.$Config{ZM_WEB_USER}.q` --shell=/bin/sh --command='`;
+     $suffix = q`'`;
+     $command = $prefix.$null_command.$suffix;
+     Debug("Testing \"$command\"");
diff --git a/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm b/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm
index ea78920c07..4329f8e8ef 100644
--- a/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm
+++ b/zoneminder/patches/patch-scripts_ZoneMinder_lib_ZoneMinder_Memory_Shared.pm
@@ -4,14 +4,15 @@ Adjust for (more) modern perl.
 
 Not submitted upstream because pkgsrc is woefully out of date.
 
---- scripts/ZoneMinder/lib/ZoneMinder/Memory/Shared.pm.orig	2016-02-03 18:40:30.000000000 +0000
+--- scripts/ZoneMinder/lib/ZoneMinder/Memory/Shared.pm.orig	2023-02-23 21:44:01.000000000 +0000
 +++ scripts/ZoneMinder/lib/ZoneMinder/Memory/Shared.pm
-@@ -158,7 +158,7 @@ sub zmMemClean
-                   ."'"
+@@ -158,6 +158,9 @@ sub zmMemClean
+                   .'\''
      ;
-     Debug( "Checking for shared memory with '$command'\n" );
--    open( my $CMD, '<', "$command |" )
-+    open( my $CMD, '-|', "$command" )
+     Debug(2, 'Checking for shared memory with '.$command);
++    # \todo
++    # -    open( my $CMD, '<', "$command |" )
++    # +    open( my $CMD, '-|', "$command" )
+     open( my $CMD, '<', $command.' |' )
          or Fatal( "Can't execute '$command': $!" );
      while( <$CMD> )
-     {
diff --git a/zoneminder/patches/patch-src_zm__event.cpp b/zoneminder/patches/patch-src_zm__event.cpp
index 3b56ce8243..38f23ee4ac 100644
--- a/zoneminder/patches/patch-src_zm__event.cpp
+++ b/zoneminder/patches/patch-src_zm__event.cpp
@@ -10,14 +10,14 @@ Also, this fix is expedient and probably a better fix is appropriate.
 
 Avoid sendfile code when sendfile doesn't exist.
 
---- src/zm_event.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_event.cpp.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_event.cpp
-@@ -87,10 +87,10 @@ Event::Event(
- 
-   char sql[ZM_SQL_MED_BUFSIZ];
-   struct tm *stime = localtime(&start_time.tv_sec);
--  snprintf( sql, sizeof(sql), "INSERT INTO Events ( MonitorId, StorageId, Name, StartTime, Width, Height, Cause, Notes, StateId, Orientation, Videoed, DefaultVideo, SaveJPEGs, Scheme ) values ( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d, %d, %d, '', %d, '%s' )",
-+  snprintf( sql, sizeof(sql), "INSERT INTO Events ( MonitorId, StorageId, Name, StartTime, Width, Height, Cause, Notes, StateId, Orientation, Videoed, DefaultVideo, SaveJPEGs, Scheme ) values ( %d, %d, 'New Event', from_unixtime( %jd ), %d, %d, '%s', '%s', %d, %d, %d, '', %d, '%s' )",
+@@ -113,10 +113,10 @@ Event::Event(
+       "INSERT INTO `Events` "
+       "( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` )"
+       " VALUES "
+-      "( %d, %d, 'New Event', from_unixtime( %ld ), %d, %d, '%s', '%s', %d, %d, %d, '%s', %d, '%s' )",
++      "( %d, %d, 'New Event', from_unixtime( %jd ), %d, %d, '%s', '%s', %d, %d, %d, '%s', %d, '%s' )",
        monitor->Id(), 
        storage->Id(),
 -      start_time.tv_sec,
@@ -25,62 +25,39 @@ Avoid sendfile code when sendfile doesn't exist.
        monitor->Width(),
        monitor->Height(),
        cause.c_str(),
-@@ -247,8 +247,8 @@ Event::~Event() {
-   if ( frames > last_db_frame ) {
-     Debug(1, "Adding closing frame %d to DB", frames);
-     snprintf(sql, sizeof(sql), 
--        "INSERT INTO Frames ( EventId, FrameId, TimeStamp, Delta ) VALUES ( %" PRIu64 ", %d, from_unixtime( %ld ), %s%ld.%02ld )",
--        id, frames, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec);
-+        "INSERT INTO Frames ( EventId, FrameId, TimeStamp, Delta ) VALUES ( %" PRIu64 ", %d, from_unixtime( %jd ), %s%jd.%02ld )",
-+        id, frames, (intmax_t) end_time.tv_sec, delta_time.positive?"":"-", (intmax_t) delta_time.sec, delta_time.fsec);
-     db_mutex.lock();
-     if ( mysql_query(&dbconn, sql) ) {
-       Error("Can't insert frame: %s", mysql_error(&dbconn));
-@@ -259,8 +259,8 @@ Event::~Event() {
-   }
- 
-   snprintf(sql, sizeof(sql), 
--      "UPDATE Events SET Name='%s %" PRIu64 "', EndTime = from_unixtime( %ld ), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo = '%s' WHERE Id = %" PRIu64,
--      monitor->EventPrefix(), id, end_time.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, video_name, id );
-+      "UPDATE Events SET Name='%s %" PRIu64 "', EndTime = from_unixtime( %jd ), Length = %s%jd.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d, DefaultVideo = '%s' WHERE Id = %" PRIu64,
-+      monitor->EventPrefix(), id, (intmax_t) end_time.tv_sec, delta_time.positive?"":"-", (intmax_t) delta_time.sec, delta_time.fsec, frames, alarm_frames, tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score, video_name, id );
-   db_mutex.lock();
-   while ( mysql_query(&dbconn, sql) && !zm_terminate ) {
-     Error("Can't update event: %s reason: %s", sql, mysql_error(&dbconn));
-@@ -479,13 +479,13 @@ void Event::AddFramesInternal( int n_fra
-     DELTA_TIMEVAL( delta_time, *(timestamps[i]), start_time, DT_PREC_2 );
-     // Delta is Decimal(8,2) so 6 integer digits and 2 decimal digits
-     if ( delta_time.sec > 999999 ) {
--      Warning("Invalid delta_time from_unixtime(%ld), %s%ld.%02ld", 
--           timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec );
-+      Warning("Invalid delta_time from_unixtime(%jd), %s%jd.%02ld", 
-+           (intmax_t) timestamps[i]->tv_sec, delta_time.positive?"":"-", (intmax_t) delta_time.sec, delta_time.fsec );
-         delta_time.sec = 0;
-     }
- 
-     int sql_len = strlen(sql);
--    snprintf(sql+sql_len, sizeof(sql)-sql_len, "( %" PRIu64 ", %d, from_unixtime(%ld), %s%ld.%02ld ), ", id, frames, timestamps[i]->tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec);
-+    snprintf(sql+sql_len, sizeof(sql)-sql_len, "( %" PRIu64 ", %d, from_unixtime(%jd), %s%jd.%02ld ), ", id, frames, (intmax_t) timestamps[i]->tv_sec, delta_time.positive?"":"-", (intmax_t) delta_time.sec, delta_time.fsec);
+@@ -164,8 +164,8 @@ Event::~Event() {
+   // Should not be static because we might be multi-threaded
+   char sql[ZM_SQL_LGE_BUFSIZ];
+   snprintf(sql, sizeof(sql),
+-      "UPDATE Events SET Name='%s%" PRIu64 "', EndDateTime = from_unixtime(%ld), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d WHERE Id = %" PRIu64 " AND Name='New Event'",
+-      monitor->EventPrefix(), id, end_time.tv_sec,
++      "UPDATE Events SET Name='%s%" PRIu64 "', EndDateTime = from_unixtime(%jd), Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d WHERE Id = %" PRIu64 " AND Name='New Event'",
++      monitor->EventPrefix(), id, (intmax_t) end_time.tv_sec,
+       delta_time.positive?"":"-", delta_time.sec, delta_time.fsec,
+       frames, alarm_frames,
+       tot_score, (int)(alarm_frames?(tot_score/alarm_frames):0), max_score,
+@@ -373,12 +373,12 @@ void Event::WriteDbFrames() {
+   while (frame_data.size()) {
+     Frame *frame = frame_data.front();
+     frame_data.pop();
+-    frame_insert_sql += stringtf("\n( %" PRIu64 ", %d, '%s', from_unixtime( %ld ), %s%ld.%02ld, %d ),",
++    frame_insert_sql += stringtf("\n( %" PRIu64 ", %d, '%s', from_unixtime( %jd ), %s%jd.%02ld, %d ),",
+         id, frame->frame_id,
+         frame_type_names[frame->type],
+-        frame->timestamp.tv_sec,
++        (intmax_t) frame->timestamp.tv_sec,
+         frame->delta.positive ? "" : "-",
+-        frame->delta.sec,
++        (intmax_t) frame->delta.sec,
+         frame->delta.fsec,
+         frame->score);
+     if (config.record_event_stats and frame->zone_stats.size()) {
+@@ -526,9 +526,9 @@ void Event::AddFrame(const std::shared_p
  
-     frameCount++;
-   } // end foreach frame
-@@ -548,8 +548,8 @@ Debug(3, "Writing video");
-     static char sql[ZM_SQL_MED_BUFSIZ];
-     snprintf(sql, sizeof(sql),
-         "INSERT INTO Frames ( EventId, FrameId, Type, TimeStamp, Delta, Score )"
--        " VALUES ( %" PRIu64 ", %d, '%s', from_unixtime( %ld ), %s%ld.%02ld, %d )",
--        id, frames, frame_type_names[frame_type], timestamp.tv_sec, delta_time.positive?"":"-", delta_time.sec, delta_time.fsec, score);
-+        " VALUES ( %" PRIu64 ", %d, '%s', from_unixtime( %jd ), %s%jd.%02ld, %d )",
-+        id, frames, frame_type_names[frame_type], (intmax_t) timestamp.tv_sec, delta_time.positive?"":"-", (intmax_t) delta_time.sec, delta_time.fsec, score);
-     db_mutex.lock();
-     if ( mysql_query(&dbconn, sql) ) {
-       Error("Can't insert frame: %s", mysql_error(&dbconn));
-@@ -563,9 +563,9 @@ Debug(3, "Writing video");
-     // We are writing a Bulk frame
-     if ( frame_type == BULK ) {
+       char sql[ZM_SQL_MED_BUFSIZ];
        snprintf(sql, sizeof(sql), 
--          "UPDATE Events SET Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %" PRIu64, 
-+          "UPDATE Events SET Length = %s%jd.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d where Id = %" PRIu64, 
+-          "UPDATE Events SET Length = %s%ld.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d WHERE Id = %" PRIu64, 
++          "UPDATE Events SET Length = %s%jd.%02ld, Frames = %d, AlarmFrames = %d, TotScore = %d, AvgScore = %d, MaxScore = %d WHERE Id = %" PRIu64, 
            ( delta_time.positive?"":"-" ),
 -          delta_time.sec, delta_time.fsec,
 +          (intmax_t) delta_time.sec, delta_time.fsec,
diff --git a/zoneminder/patches/patch-src_zm__eventstream.cpp b/zoneminder/patches/patch-src_zm__eventstream.cpp
index 09166a0ca5..2aa34a98ba 100644
--- a/zoneminder/patches/patch-src_zm__eventstream.cpp
+++ b/zoneminder/patches/patch-src_zm__eventstream.cpp
@@ -3,21 +3,16 @@ $NetBSD$
 Only include local sendfile header if there is sendfile support, to
 avoid #error for no sendfile implementation.
 
---- src/zm_eventstream.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_eventstream.cpp.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_eventstream.cpp
-@@ -39,12 +39,14 @@
- #include "zm_storage.h"
- #include "zm_monitor.h"
+@@ -43,8 +43,8 @@ const std::string EventStream::StreamMod
  
-+#if HAVE_SENDFILE
- #include "zm_sendfile.h"
-+#endif
+ bool EventStream::loadInitialEventData(int monitor_id, time_t event_time) {
+   std::string sql = stringtf("SELECT `Id` FROM `Events` WHERE "
+-                             "`MonitorId` = %d AND unix_timestamp(`EndDateTime`) > %ld "
+-                             "ORDER BY `Id` ASC LIMIT 1", monitor_id, event_time);
++                             "`MonitorId` = %d AND unix_timestamp(`EndDateTime`) > %jd "
++                             "ORDER BY `Id` ASC LIMIT 1", monitor_id, (intmax_t) event_time);
  
- bool EventStream::loadInitialEventData( int monitor_id, time_t event_time ) {
-   static char sql[ZM_SQL_SML_BUFSIZ];
- 
--  snprintf(sql, sizeof(sql), "SELECT Id FROM Events WHERE MonitorId = %d AND unix_timestamp(EndTime) > %ld ORDER BY Id ASC LIMIT 1", monitor_id, event_time);
-+  snprintf(sql, sizeof(sql), "SELECT Id FROM Events WHERE MonitorId = %d AND unix_timestamp(EndTime) > %jd ORDER BY Id ASC LIMIT 1", monitor_id, (intmax_t) event_time);
- 
-   if ( mysql_query(&dbconn, sql) ) {
-     Error("Can't run query: %s", mysql_error(&dbconn));
+   MYSQL_RES *result = zmDbFetch(sql.c_str());
+   if (!result)
diff --git a/zoneminder/patches/patch-src_zm__monitor.cpp b/zoneminder/patches/patch-src_zm__monitor.cpp
index 15d961fe42..1a42c46e81 100644
--- a/zoneminder/patches/patch-src_zm__monitor.cpp
+++ b/zoneminder/patches/patch-src_zm__monitor.cpp
@@ -7,32 +7,32 @@ particular values that might make sense.
 
 Avoid type error (suseconds_t is not long).  To be addressed upstream once caught up.
 
---- src/zm_monitor.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_monitor.cpp.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_monitor.cpp
-@@ -180,7 +180,7 @@ bool Monitor::MonitorLink::connect() {
-       return( false );
+@@ -200,7 +200,7 @@ bool Monitor::MonitorLink::connect() {
      }
-     mem_ptr = (unsigned char *)shmat( shm_id, 0, 0 );
--    if ( mem_ptr < (void *)0 ) {
-+    if ( mem_ptr == (void *)-1 ) {
-       Debug( 3, "Can't shmat link memory: %s", strerror(errno) );
+ #else // ZM_MEM_MAPPED
+     shm_id = shmget((config.shm_key&0xffff0000)|id, mem_size, 0700);
+-    if (shm_id < 0) {
++    if (shm_id == (void *)-1) {
+       Debug(3, "Can't shmget link memory: %s", strerror(errno));
        connected = false;
-       return( false );
-@@ -210,7 +210,7 @@ bool Monitor::MonitorLink::disconnect() 
+       return false;
+@@ -236,7 +236,7 @@ bool Monitor::MonitorLink::disconnect() 
      connected = false;
  
  #if ZM_MEM_MAPPED
--    if ( mem_ptr > (void *)0 ) {
-+    if ( mem_ptr != (void *)0 && mem_ptr != (void *)-1) {
-       msync( mem_ptr, mem_size, MS_ASYNC );
-       munmap( mem_ptr, mem_size );
+-    if (mem_ptr > (void *)0) {
++    if (mem_ptr != (void *)0 && mem_ptr != (void *)-1) {
+       msync(mem_ptr, mem_size, MS_ASYNC);
+       munmap(mem_ptr, mem_size);
      }
-@@ -2531,7 +2531,7 @@ void Monitor::TimestampImage( Image *ts_
-             found_macro = true;
-             break;
-           case 'f' :
--            d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", ts_time->tv_usec/10000 );
-+            d_ptr += snprintf( d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", (long) ts_time->tv_usec/10000 );
-             found_macro = true;
-             break;
-         }
+@@ -2649,7 +2649,7 @@ void Monitor::TimestampImage(Image *ts_i
+           found_macro = true;
+           break;
+         case 'f' :
+-          d_ptr += snprintf(d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", ts_time.tv_usec/10000);
++          d_ptr += snprintf(d_ptr, sizeof(label_text)-(d_ptr-label_text), "%02ld", (long) ts_time.tv_usec/10000);
+           found_macro = true;
+           break;
+       }
diff --git a/zoneminder/patches/patch-src_zm__rtp__ctrl.h b/zoneminder/patches/patch-src_zm__rtp__ctrl.h
index 0f66d0db81..b702331054 100644
--- a/zoneminder/patches/patch-src_zm__rtp__ctrl.h
+++ b/zoneminder/patches/patch-src_zm__rtp__ctrl.h
@@ -5,14 +5,3 @@ Work around:
 
 Not reported upstream because pkgsrc is out of date; to be done if this is not resolved by updating.
 
---- src/zm_rtp_ctrl.h.orig	2019-02-22 15:38:47.000000000 +0000
-+++ src/zm_rtp_ctrl.h
-@@ -125,7 +125,7 @@ private:
-       // BYE
-       struct
-       {
--        uint32_t srcN[];   // list of sources
-+        uint32_t srcN[0];   // list of sources
-         // can't express trailing text for reason (what does this mean? it's not even english!)
-       } bye;
-      } body;
diff --git a/zoneminder/patches/patch-src_zm__rtp__source.cpp b/zoneminder/patches/patch-src_zm__rtp__source.cpp
index a8efba866a..6d4963eb09 100644
--- a/zoneminder/patches/patch-src_zm__rtp__source.cpp
+++ b/zoneminder/patches/patch-src_zm__rtp__source.cpp
@@ -2,25 +2,28 @@ $NetBSD: patch-src_zm__rtp__source.cpp,v 1.2 2018/07/14 15:03:57 gdt Exp $
 
 Fix type issue with tv_sec; see earlier patches.
 
---- src/zm_rtp_source.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_rtp_source.cpp.orig	2023-02-23 21:44:01.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)) );
+@@ -196,17 +196,17 @@ void RtpSource::updateRtcpData(
+     uint32_t rtpTime) {
+   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: %jd.%06ld, rtpTime: %x", (intmax_t) ntpTime.tv_sec, ntpTime.tv_usec, rtpTime );
+-  Debug(5, "ntpTime: %ld.%06ld, rtpTime: %x", ntpTime.tv_sec, ntpTime.tv_usec, rtpTime);
++  Debug(5, "ntpTime: %jd.%06ld, rtpTime: %x", (intmax_t) ntpTime.tv_sec, (long) 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: %jd.%06ld, rtpTime: %x", (intmax_t) mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime );
-+    Debug( 5, "ntpTime: %jd.%06ld, rtpTime: %x", (intmax_t) ntpTime.tv_sec, ntpTime.tv_usec, rtpTime );
+   if ( mBaseTimeNtp.tv_sec == 0 ) {
+     mBaseTimeReal = tvNow();
+     mBaseTimeNtp = ntpTime;
+     mBaseTimeRtp = rtpTime;
+   } else if ( !mRtpClock ) {
+-    Debug(5, "lastSrNtpTime: %ld.%06ld, rtpTime: %x"
+-        "ntpTime: %ld.%06ld, rtpTime: %x",
+-        mLastSrTimeNtp.tv_sec, mLastSrTimeNtp.tv_usec, rtpTime,
+-        ntpTime.tv_sec, ntpTime.tv_usec, rtpTime);
++    Debug(5, "lastSrNtpTime: %jd.%06ld, rtpTime: %x"
++        "ntpTime: %jd.%06ld, rtpTime: %x",
++	(intmax_t) mLastSrTimeNtp.tv_sec, (long) mLastSrTimeNtp.tv_usec, rtpTime,
++        (intmax_t) ntpTime.tv_sec, (long) ntpTime.tv_usec, rtpTime);
  
      double diffNtpTime = tvDiffSec( mBaseTimeNtp, ntpTime );
      uint32_t diffRtpTime = rtpTime - mBaseTimeRtp;
diff --git a/zoneminder/patches/patch-src_zm__utils.cpp b/zoneminder/patches/patch-src_zm__utils.cpp
index a1dd0b4fef..448dd615ef 100644
--- a/zoneminder/patches/patch-src_zm__utils.cpp
+++ b/zoneminder/patches/patch-src_zm__utils.cpp
@@ -4,26 +4,18 @@ Avoid assuming linux on arm.  For now, assume neon.
 
 Fix time types (sizes).
 
---- src/zm_utils.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_utils.cpp.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_utils.cpp
-@@ -26,7 +26,7 @@
- #include <stdarg.h>
- #include <fcntl.h> /* Definition of AT_* constants */
- #include <sys/stat.h>
--#if defined(__arm__)
-+#if defined(__arm__) && defined(__linux__)
- #include <sys/auxv.h>
- #endif
+@@ -183,7 +183,7 @@ std::string TimevalToString(timeval tv) 
+     return "";
+   }
+ 
+-  return stringtf("%s.%06ld", tm_buf.data(), tv.tv_usec);
++  return stringtf("%s.%06ld", tm_buf.data(), (long) tv.tv_usec);
+ }
  
-@@ -305,6 +305,7 @@ void hwcaps_detect() {
-     Debug(1,"Detected a x86\\x86-64 processor");
-   } 
- #elif defined(__arm__)
-+#  if defined(__linux__)
-   // ARM processor in 32bit mode
-   // To see if it supports NEON, we need to get that information from the kernel
-   unsigned long auxval = getauxval(AT_HWCAP);
-@@ -314,6 +315,10 @@ void hwcaps_detect() {
+ /* Detect special hardware features, such as SIMD instruction sets */
+@@ -238,6 +238,10 @@ void HwCapsDetect() {
    } else {
      Debug(1,"Detected ARM (AArch32) processor");
    }
@@ -34,12 +26,3 @@ Fix time types (sizes).
  #elif defined(__aarch64__)
    // ARM processor in 64bit mode
    // Neon is mandatory, no need to check for it
-@@ -397,7 +402,7 @@ char *timeval_to_string( struct timeval 
-   nowtime = tv.tv_sec;
-   nowtm = localtime(&nowtime);
-   strftime(tmbuf, sizeof tmbuf, "%Y-%m-%d %H:%M:%S", nowtm);
--  snprintf(buf, sizeof buf, "%s.%06ld", tmbuf, tv.tv_usec);
-+  snprintf(buf, sizeof buf, "%s.%06jd", tmbuf, (intmax_t) tv.tv_usec);
-   return buf;
- }
- 
diff --git a/zoneminder/patches/patch-src_zm_comms_cpp b/zoneminder/patches/patch-src_zm_comms_cpp
deleted file mode 100644
index 20a76bc9cb..0000000000
--- a/zoneminder/patches/patch-src_zm_comms_cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-src_zm_comms_cpp,v 1.2 2013/03/24 16:47:47 joerg Exp $
-
-Don't attempt to include headers that don't exist.
-
---- src/zm_comms.cpp.orig	2016-02-03 18:40:30.000000000 +0000
-+++ src/zm_comms.cpp
-@@ -28,8 +28,10 @@
- #if defined(BSD)
- #include <stdlib.h>
- #else
-+#ifdef HAVE_ALLOCA_H
- #include <alloca.h>
- #endif
-+#endif
- 
- //#include <unistd.h>
- #include <sys/ioctl.h>
diff --git a/zoneminder/patches/patch-src_zm_comms_h b/zoneminder/patches/patch-src_zm_comms_h
index b1775204d1..51757be7a7 100644
--- a/zoneminder/patches/patch-src_zm_comms_h
+++ b/zoneminder/patches/patch-src_zm_comms_h
@@ -7,24 +7,26 @@ Include missing system headers for NetBSD.
 To fix Linux readv/writev, back-port:
 https://github.com/ZoneMinder/zoneminder/commit/417421b1d869d1b71c8ec1a1e3b082fcede6ce58#diff-484f666f58ec13f38fa402143f2f6ad8e63a013909d3941ffbb3d66745b20c8d
 
---- src/zm_comms.h.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_comms.h.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_comms.h
-@@ -22,20 +22,24 @@
+@@ -22,18 +22,27 @@
  
  #include "zm_exception.h"
- 
+ #include "zm_logger.h"
+-#include <cerrno>
++
++/* \todo  Validate that this is still needed. */
 +extern "C" {
- #include <string.h>
- #include <unistd.h>
  #include <netdb.h>
- #include <errno.h>
- #include <sys/un.h>
--
 -#include <set>
+ #include <sys/uio.h>
+ #include <sys/un.h>
+ #include <unistd.h>
 -#include <vector>
++
++/* \todo Validate this addition. */
 +#include <stdlib.h>
 +#include <time.h>
- #include <sys/uio.h>
  
  #if defined(BSD)
  #include <sys/socket.h>
@@ -32,8 +34,9 @@ https://github.com/ZoneMinder/zoneminder/commit/417421b1d869d1b71c8ec1a1e3b082fc
  #endif
 +}
 +
++#include <cerrno>
 +#include <set>
 +#include <vector>
  
- class CommsException : public Exception {
- public:
+ namespace ZM {
+ 
diff --git a/zoneminder/patches/patch-src_zm_logger_cpp b/zoneminder/patches/patch-src_zm_logger_cpp
index 6d0561ccd1..f3b130215f 100644
--- a/zoneminder/patches/patch-src_zm_logger_cpp
+++ b/zoneminder/patches/patch-src_zm_logger_cpp
@@ -9,31 +9,32 @@ to use SYS_gettid.
 
 Fix time types (sizes).
 
---- src/zm_logger.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_logger.cpp.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_logger.cpp
-@@ -464,12 +464,12 @@ void Logger::logPrint( bool hex, const c
+@@ -439,13 +439,13 @@ void Logger::logPrint(bool hex, const ch
  
      subtractTime( &timeVal, &logStart );
  
 -    snprintf( timeString, sizeof(timeString), "%ld.%03ld", timeVal.tv_sec, timeVal.tv_usec/1000 );
-+    snprintf( timeString, sizeof(timeString), "%jd.%03ld", (intmax_t) timeVal.tv_sec, timeVal.tv_usec/1000 );
++    snprintf( timeString, sizeof(timeString), "%jd.%03ld", (intmax_t) timeVal.tv_sec, (long) timeVal.tv_usec/1000 );
    } else {
  #endif
      char *timePtr = timeString;
-     timePtr += strftime(timePtr, sizeof(timeString), "%x %H:%M:%S", localtime(&timeVal.tv_sec));
+     tm now_tm = {};
+     timePtr += strftime(timePtr, sizeof(timeString), "%x %H:%M:%S", localtime_r(&timeVal.tv_sec, &now_tm));
 -    snprintf(timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", timeVal.tv_usec);
-+    snprintf(timePtr, sizeof(timeString)-(timePtr-timeString), ".%06jd", (intmax_t) timeVal.tv_usec);
++    snprintf(timePtr, sizeof(timeString)-(timePtr-timeString), ".%06ld", (long) timeVal.tv_usec);
  #if 0
    }
  #endif
-@@ -548,8 +548,8 @@ void Logger::logPrint( bool hex, const c
-           "INSERT INTO Logs "
-           "( TimeKey, Component, ServerId, Pid, Level, Code, Message, File, Line )"
-          " VALUES "
--         "( %ld.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )",
--         timeVal.tv_sec, timeVal.tv_usec, mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, escapedString, file, line
-+         "( %jd.%06jd, '%s', %d, %d, %d, '%s', '%s', '%s', %d )",
-+         (intmax_t) timeVal.tv_sec, (intmax_t) timeVal.tv_usec, mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, escapedString, file, line
-          );
-       if ( mysql_query(&dbconn, sql) ) {
-         Level tempDatabaseLevel = mDatabaseLevel;
+@@ -534,8 +534,8 @@ void Logger::logPrint(bool hex, const ch
+           "INSERT INTO `Logs` "
+           "( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` )"
+           " VALUES "
+-          "( %ld.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )",
+-          timeVal.tv_sec, timeVal.tv_usec, mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, escapedString.c_str(), file, line
++          "( %jd.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )",
++          (intmax_t) timeVal.tv_sec, (long) timeVal.tv_usec, mId.c_str(), staticConfig.SERVER_ID, tid, level, classString, escapedString.c_str(), file, line
+           );
+       dbQueue.push(std::move(sql_string));
+     } else {
diff --git a/zoneminder/patches/patch-src_zm_remote_camera_h b/zoneminder/patches/patch-src_zm_remote_camera_h
index 09fa3f6b02..f5ec893c68 100644
--- a/zoneminder/patches/patch-src_zm_remote_camera_h
+++ b/zoneminder/patches/patch-src_zm_remote_camera_h
@@ -2,21 +2,16 @@ $NetBSD: patch-src_zm_remote_camera_h,v 1.4 2015/04/05 08:51:08 dsainty Exp $
 
 Declare sockaddr_in.
 
---- src/zm_remote_camera.h.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zm_remote_camera.h.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zm_remote_camera.h
-@@ -23,11 +23,15 @@
- #include "zm_camera.h"
+@@ -24,6 +24,10 @@
  #include "zm_rtsp_auth.h"
- 
-+
-+
  #include <string>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
+ 
++/* \todo Validate if necessary. */
 +#include <netinet/in.h>
- #include <arpa/inet.h>
 +#include <time.h>
- 
++
  #define SOCKET_BUF_SIZE 8192
  
+ //
diff --git a/zoneminder/patches/patch-src_zmc_cpp b/zoneminder/patches/patch-src_zmc_cpp
deleted file mode 100644
index 128843a3d7..0000000000
--- a/zoneminder/patches/patch-src_zmc_cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-$NetBSD: patch-src_zmc_cpp,v 1.2 2013/03/24 16:47:47 joerg Exp $
-
-Use a more appropriate initialisation for a long, and use the definition out
-of <limits.h>, for portability.
-
---- src/zmc.cpp.orig	2018-12-08 14:22:36.000000000 +0000
-+++ src/zmc.cpp
-@@ -55,7 +55,7 @@ possible, this should run at more or les
- 
- #include <getopt.h>
- #include <signal.h>
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
- #include <limits.h>
- #else
- #include <values.h>
-@@ -278,7 +278,7 @@ int main(int argc, char *argv[]) {
-     while ( !zm_terminate ) {
-       sigprocmask(SIG_BLOCK, &block_set, 0);
-       for ( int i = 0; i < n_monitors; i++ ) {
--        long min_delay = MAXINT;
-+        long min_delay = LONG_MAX;
- 
-         gettimeofday(&now, NULL);
-         for ( int j = 0; j < n_monitors; j++ ) {
diff --git a/zoneminder/patches/patch-src_zmu.cpp b/zoneminder/patches/patch-src_zmu.cpp
index 5f73327397..00c4469b8e 100644
--- a/zoneminder/patches/patch-src_zmu.cpp
+++ b/zoneminder/patches/patch-src_zmu.cpp
@@ -2,51 +2,51 @@ $NetBSD: patch-src_zmu.cpp,v 1.2 2018/07/14 15:03:57 gdt Exp $
 
 time types
 
---- src/zmu.cpp.orig	2018-12-08 14:22:36.000000000 +0000
+--- src/zmu.cpp.orig	2023-02-23 21:44:01.000000000 +0000
 +++ src/zmu.cpp
-@@ -494,12 +494,12 @@ int main(int argc, char *argv[]) {
-           if ( timestamp.tv_sec )
-             strftime( timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", localtime( &timestamp.tv_sec ) );
-           if ( image_idx == -1 )
--            printf( "Time of last image capture: %s.%02ld\n", timestamp_str, timestamp.tv_usec/10000 );
-+            printf( "Time of last image capture: %s.%02ld\n", timestamp_str, (long) timestamp.tv_usec/10000 );
-           else
--            printf( "Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, timestamp.tv_usec/10000 );
-+            printf( "Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, (long) timestamp.tv_usec/10000 );
-         } else {
-           if ( have_output ) printf( "%c", separator );
--          printf( "%ld.%02ld", timestamp.tv_sec, timestamp.tv_usec/10000 );
-+          printf( "%jd.%02ld", (intmax_t) timestamp.tv_sec, (long) timestamp.tv_usec/10000 );
-           have_output = true;
+@@ -542,12 +542,12 @@ int main(int argc, char *argv[]) {
+           strftime(timestamp_str, sizeof(timestamp_str), "%Y-%m-%d %H:%M:%S", localtime_r(&timestamp.tv_sec, &tm_info));
          }
+         if ( image_idx == -1 )
+-          printf("Time of last image capture: %s.%02ld\n", timestamp_str, timestamp.tv_usec/10000);
++          printf("Time of last image capture: %s.%02ld\n", timestamp_str, (long) timestamp.tv_usec/10000);
+         else
+-          printf("Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, timestamp.tv_usec/10000);
++          printf("Time of image %d capture: %s.%02ld\n", image_idx, timestamp_str, (long) timestamp.tv_usec/10000);
+       } else {
+         if ( have_output ) fputc(separator, stdout);
+-        printf("%ld.%02ld", timestamp.tv_sec, timestamp.tv_usec/10000);
++        printf("%jd.%02ld", (intmax_t) timestamp.tv_sec, (long) timestamp.tv_usec/10000);
+         have_output = true;
        }
-@@ -718,12 +718,12 @@ int main(int argc, char *argv[]) {
-             Monitor *monitor = Monitor::Load( mon_id, false, Monitor::QUERY );
+     }
+@@ -777,12 +777,12 @@ int main(int argc, char *argv[]) {
+             std::shared_ptr<Monitor> monitor = Monitor::Load(monitor_id, false, Monitor::QUERY);
              if ( monitor && monitor->connect() ) {
                struct timeval tv = monitor->GetTimestamp();
 -              printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8" PRIu64 "%8.2f\n",
-+              printf( "%4d%5d%6d%9d%11jd.%02jd%6d%6d%8" PRIu64 "%8.2f\n",
++              printf( "%4d%5d%6d%9d%11jd.%02ld%6d%6d%8" PRIu64 "%8.2f\n",
                  monitor->Id(),
-                 function,
+                 monitor_function,
                  monitor->GetState(),
                  monitor->GetTriggerState(),
 -                tv.tv_sec, tv.tv_usec/10000,
-+                (intmax_t) tv.tv_sec, (intmax_t) tv.tv_usec/10000,
++		(intmax_t) tv.tv_sec, (long) tv.tv_usec/10000,
                  monitor->GetLastReadIndex(),
                  monitor->GetLastWriteIndex(),
                  monitor->GetLastEventId(),
-@@ -733,12 +733,12 @@ int main(int argc, char *argv[]) {
+@@ -791,12 +791,12 @@ int main(int argc, char *argv[]) {
              }
            } else {
              struct timeval tv = { 0, 0 };
--            printf( "%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n",
-+            printf( "%4d%5d%6d%9d%11jd.%02jd%6d%6d%8d%8.2f\n",
+-            printf("%4d%5d%6d%9d%11ld.%02ld%6d%6d%8d%8.2f\n",
++            printf("%4d%5d%6d%9d%11jd.%02ld%6d%6d%8d%8.2f\n",
                mon_id,
                function,
                0,
                0,
 -              tv.tv_sec, tv.tv_usec/10000,
-+              (intmax_t) tv.tv_sec, (intmax_t) tv.tv_usec/10000,
++              (intmax_t) tv.tv_sec, (long) tv.tv_usec/10000,
                0,
                0,
                0,



Home | Main Index | Thread Index | Old Index