diff --git a/distros/debian/patches/01_vendor-perl.diff b/distros/debian/patches/01_vendor-perl.diff deleted file mode 100644 index a58ef8778..000000000 --- a/distros/debian/patches/01_vendor-perl.diff +++ /dev/null @@ -1,17 +0,0 @@ -Index: ZoneMinder/configure.ac -=================================================================== ---- ZoneMinder.orig/configure.ac 2014-12-13 15:10:27.705191682 +0100 -+++ ZoneMinder/configure.ac 2014-12-13 16:50:07.101049743 +0100 -@@ -443,10 +443,10 @@ - PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"` - PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"` - EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path" -- PERL_MM_PARMS="PREFIX=$prefix" -+ PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\"" - else - EXTRA_PERL_LIB="# Include from system perl paths only" -- PERL_MM_PARMS= -+ PERL_MM_PARMS="\"INSTALLDIRS=vendor\"" - fi - AC_SUBST(PERL_MM_PARMS) - AC_SUBST(EXTRA_PERL_LIB) diff --git a/distros/debian/patches/series b/distros/debian/patches/series index b479dc507..e69de29bb 100644 --- a/distros/debian/patches/series +++ b/distros/debian/patches/series @@ -1 +0,0 @@ -01_vendor-perl.diff diff --git a/distros/debian8/patches/01_vendor-perl.diff b/distros/debian8/patches/01_vendor-perl.diff deleted file mode 100644 index fe013a0f1..000000000 --- a/distros/debian8/patches/01_vendor-perl.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -550,10 +550,10 @@ - PERL_SITE_LIB=`perl -V:installsitelib | sed -e "s/.*='\(.*\)';/\1/"` - PERL_LIB_PATH=`echo $PERL_SITE_LIB | sed -e "s|^$PERL_SITE_PREFIX||"` - EXTRA_PERL_LIB="use lib '$prefix$PERL_LIB_PATH'; # Include custom perl install path" -- PERL_MM_PARMS="PREFIX=$prefix" -+ PERL_MM_PARMS="\"PREFIX=$prefix INSTALLDIRS=vendor\"" - else - EXTRA_PERL_LIB="# Include from system perl paths only" -- PERL_MM_PARMS= -+ PERL_MM_PARMS="\"INSTALLDIRS=vendor\"" - fi - AC_SUBST(PERL_MM_PARMS) - AC_SUBST(EXTRA_PERL_LIB) diff --git a/distros/debian8/patches/series b/distros/debian8/patches/series index a7d63eddc..236833b1e 100644 --- a/distros/debian8/patches/series +++ b/distros/debian8/patches/series @@ -1,2 +1,5 @@ +<<<<<<< HEAD 01_vendor-perl.diff 02_service-file-name.diff +======= +>>>>>>> ac80649e26d0197bf15dc06e505ecc86bd0aae68 diff --git a/scripts/zmfilter.pl.in b/scripts/zmfilter.pl.in index 1d55e0d40..ca380e539 100755 --- a/scripts/zmfilter.pl.in +++ b/scripts/zmfilter.pl.in @@ -278,7 +278,7 @@ sub getFilters my $sql = "select E.Id,E.MonitorId,M.Name as MonitorName,M.DefaultRate,M.DefaultScale,E.Name,E.Cause,E.Notes,E.StartTime,unix_timestamp(E.StartTime) as Time,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.Videoed,E.Uploaded,E.Emailed,E.Messaged,E.Executed from Events as E inner join Monitors as M on M.Id = E.MonitorId"; $db_filter->{Sql} = ''; - if ( @{$filter_expr->{terms}} ) + if ( $filter_expr->{terms} ) { for ( my $i = 0; $i < @{$filter_expr->{terms}}; $i++ ) { diff --git a/src/zm_comms.cpp b/src/zm_comms.cpp index 56bebf01b..c42b7bd17 100644 --- a/src/zm_comms.cpp +++ b/src/zm_comms.cpp @@ -31,12 +31,9 @@ #include #endif -#include //#include #include #include -//#include -//#include #include int CommsBase::readV( int iovcnt, /* const void *, int, */ ... ) diff --git a/src/zm_comms.h b/src/zm_comms.h index 60d4a3ad4..ef1dda833 100644 --- a/src/zm_comms.h +++ b/src/zm_comms.h @@ -22,6 +22,7 @@ #include "zm_exception.h" +#include #include #include #include @@ -30,6 +31,12 @@ #include #include +#if defined(BSD) +#include +#include +#include +#endif + class CommsException : public Exception { public: diff --git a/web/ajax/log.php b/web/ajax/log.php index 4fb1ebed7..3dc3072ea 100644 --- a/web/ajax/log.php +++ b/web/ajax/log.php @@ -188,9 +188,9 @@ switch ( $_REQUEST['task'] ) } $exportKey = substr(md5(rand()),0,8); $exportFile = "zm-log.$exportExt"; - $exportPath = "temp/zm-log-$exportKey.$exportExt"; + $exportPath = ZM_PATH_SWAP."/zm-log-$exportKey.$exportExt"; if ( !($exportFP = fopen( $exportPath, "w" )) ) - Fatal( "Unable to open log export file $exportFile" ); + Fatal( "Unable to open log export file $exportPath" ); $logs = array(); foreach ( dbFetchAll( $sql, NULL, $values ) as $log ) { diff --git a/web/includes/functions.php b/web/includes/functions.php index 64a7e3953..a521b52c1 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -1611,19 +1611,14 @@ function sortTag( $field ) function getLoad() { - $uptime = shell_exec( 'uptime' ); - $load = ''; - if ( preg_match( '/load average: ([\d.]+)/', $uptime, $matches ) ) - $load = $matches[1]; - return( $load ); + $load = sys_getloadavg(); + return( $load[0] ); } function getDiskPercent() { - $df = shell_exec( 'df '.ZM_DIR_EVENTS ); - $space = -1; - if ( preg_match( '/\s(\d+)%/ms', $df, $matches ) ) - $space = $matches[1]; + $total = disk_total_space(ZM_DIR_EVENTS); + $space = round(($total - disk_free_space(ZM_DIR_EVENTS)) / $total * 100); return( $space ); }