Merge branch 'storageareas' of github.com:ZoneMinder/ZoneMinder into storageareas

This commit is contained in:
Isaac Connor 2016-04-28 11:34:49 -04:00
commit a141064aad
6 changed files with 28 additions and 34 deletions

View File

@ -840,7 +840,7 @@ bool EventStream::loadInitialEventData( int monitor_id, time_t event_time )
return( true ); return( true );
} }
bool EventStream::loadInitialEventData( int init_event_id, int init_frame_id ) bool EventStream::loadInitialEventData( int init_event_id, unsigned int init_frame_id )
{ {
loadEventData( init_event_id ); loadEventData( init_event_id );

View File

@ -247,7 +247,7 @@ protected:
protected: protected:
bool loadEventData( int event_id ); bool loadEventData( int event_id );
bool loadInitialEventData( int init_event_id, int init_frame_id ); bool loadInitialEventData( int init_event_id, unsigned int init_frame_id );
bool loadInitialEventData( int monitor_id, time_t event_time ); bool loadInitialEventData( int monitor_id, time_t event_time );
void checkEventLoaded(); void checkEventLoaded();
@ -266,7 +266,7 @@ public:
event_data = 0; event_data = 0;
} }
void setStreamStart( int init_event_id, int init_frame_id=0 ) void setStreamStart( int init_event_id, unsigned int init_frame_id=0 )
{ {
loadInitialEventData( init_event_id, init_frame_id ); loadInitialEventData( init_event_id, init_frame_id );
loadMonitor( event_data->monitor_id ); loadMonitor( event_data->monitor_id );

View File

@ -47,15 +47,12 @@ RETSIGTYPE zm_die_handler(int signal, siginfo_t * info, void *context)
RETSIGTYPE zm_die_handler(int signal) RETSIGTYPE zm_die_handler(int signal)
#endif #endif
{ {
#if (defined(__i386__) || defined(__x86_64__))
void *cr2 = 0;
void *ip = 0;
#endif
Error("Got signal %d (%s), crashing", signal, strsignal(signal)); Error("Got signal %d (%s), crashing", signal, strsignal(signal));
#if (defined(__i386__) || defined(__x86_64__)) #if (defined(__i386__) || defined(__x86_64__))
// Get more information if available // Get more information if available
#if ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) #if ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T )
void *ip = 0;
void *cr2 = 0;
if (info && context) { if (info && context) {
Debug(1, Debug(1,
@ -65,19 +62,19 @@ RETSIGTYPE zm_die_handler(int signal)
ucontext_t *uc = (ucontext_t *) context; ucontext_t *uc = (ucontext_t *) context;
cr2 = info->si_addr; cr2 = info->si_addr;
#if defined(__x86_64__) #if defined(__x86_64__)
#ifdef __FreeBSD_kernel__ #ifdef __FreeBSD_kernel__
ip = (void *)(uc->uc_mcontext.mc_rip); ip = (void *)(uc->uc_mcontext.mc_rip);
#else #else
ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]); ip = (void *)(uc->uc_mcontext.gregs[REG_RIP]);
#endif #endif
#else #else
#ifdef __FreeBSD_kernel__ #ifdef __FreeBSD_kernel__
ip = (void *)(uc->uc_mcontext.mc_eip); ip = (void *)(uc->uc_mcontext.mc_eip);
#else #else
ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]); ip = (void *)(uc->uc_mcontext.gregs[REG_EIP]);
#endif #endif
#endif // defined(__x86_64__) #endif // defined(__x86_64__)
// Print the signal address and instruction pointer if available // Print the signal address and instruction pointer if available
if (ip) { if (ip) {
@ -86,11 +83,11 @@ RETSIGTYPE zm_die_handler(int signal)
Error("Signal address is %p, no instruction pointer", cr2); Error("Signal address is %p, no instruction pointer", cr2);
} }
} }
#endif // ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T ) #endif // ( HAVE_SIGINFO_T && HAVE_UCONTEXT_T )
// Print backtrace if enabled and available // Print backtrace if enabled and available
#if ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS ) #if ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS )
void *trace[TRACE_SIZE]; void *trace[TRACE_SIZE];
int trace_size = 0; int trace_size = 0;
trace_size = backtrace(trace, TRACE_SIZE); trace_size = backtrace(trace, TRACE_SIZE);
@ -111,7 +108,7 @@ RETSIGTYPE zm_die_handler(int signal)
Info("Backtrace complete, please execute the following command for more information"); Info("Backtrace complete, please execute the following command for more information");
Info(cmd); Info(cmd);
#endif // ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS ) #endif // ( !defined(ZM_NO_CRASHTRACE) && HAVE_DECL_BACKTRACE && HAVE_DECL_BACKTRACE_SYMBOLS )
#endif // (defined(__i386__) || defined(__x86_64__) #endif // (defined(__i386__) || defined(__x86_64__)
exit(signal); exit(signal);
} }

View File

@ -62,7 +62,7 @@ int main( int argc, const char *argv[] )
int monitor_id = 0; int monitor_id = 0;
time_t event_time = 0; time_t event_time = 0;
int event_id = 0; int event_id = 0;
int frame_id = 1; unsigned int frame_id = 1;
unsigned int scale = 100; unsigned int scale = 100;
unsigned int rate = 100; unsigned int rate = 100;
double maxfps = 10.0; double maxfps = 10.0;

View File

@ -756,15 +756,14 @@ int main( int argc, char *argv[] )
if ( function & ZMU_LIST ) if ( function & ZMU_LIST )
{ {
char sql[ZM_SQL_SML_BUFSIZ]; std::string sql = "select Id, Function+0 from Monitors";
strncpy( sql, "select Id, Function+0 from Monitors", sizeof(sql) );
if ( !verbose ) if ( !verbose )
{ {
strncat( sql, " where Function != 'None'", sizeof(sql)-strlen(sql) ); sql += "where Function != 'None'";
} }
strncat( sql, " order by Id asc", sizeof(sql)-strlen(sql) ); sql += " order by Id asc";
if ( mysql_query( &dbconn, sql ) ) if ( mysql_query( &dbconn, sql.c_str() ) )
{ {
Error( "Can't run query: %s", mysql_error( &dbconn ) ); Error( "Can't run query: %s", mysql_error( &dbconn ) );
exit( mysql_errno( &dbconn ) ); exit( mysql_errno( &dbconn ) );

View File

@ -66,13 +66,11 @@ if ( !empty($limit) && $nEvents > $limit )
$nEvents = $limit; $nEvents = $limit;
} }
$pages = (int)ceil($nEvents/ZM_WEB_EVENTS_PER_PAGE); $pages = (int)ceil($nEvents/ZM_WEB_EVENTS_PER_PAGE);
if ( $pages > 1 ) { if ( !empty($page) ) {
if ( !empty($page) ) { if ( $page < 0 )
if ( $page < 0 ) $page = 1;
$page = 1; if ( $page > $pages )
if ( $page > $pages ) $page = $pages;
$page = $pages;
}
} }
if ( !empty($page) ) { if ( !empty($page) ) {
$limitStart = (($page-1)*ZM_WEB_EVENTS_PER_PAGE); $limitStart = (($page-1)*ZM_WEB_EVENTS_PER_PAGE);