From 18f196dbcd1aedc60323a161b258f99615b5f127 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 14 Apr 2009 20:18:57 +0000 Subject: [PATCH] Added srand initialisation. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2848 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zma.cpp | 2 ++ src/zmc.cpp | 2 ++ src/zmf.cpp | 2 ++ src/zms.cpp | 2 ++ src/zmu.cpp | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/zma.cpp b/src/zma.cpp index 1dfd7716b..722582c97 100644 --- a/src/zma.cpp +++ b/src/zma.cpp @@ -36,6 +36,8 @@ void Usage() int main( int argc, char *argv[] ) { + srand( getpid() * time( 0 ) ); + int id = -1; static struct option long_options[] = { diff --git a/src/zmc.cpp b/src/zmc.cpp index 9839a032c..41250c1c1 100644 --- a/src/zmc.cpp +++ b/src/zmc.cpp @@ -42,6 +42,8 @@ void Usage() int main( int argc, char *argv[] ) { + srand( getpid() * time( 0 ) ); + const char *device = ""; const char *protocol = ""; const char *host = ""; diff --git a/src/zmf.cpp b/src/zmf.cpp index d5d58f132..7e890951e 100644 --- a/src/zmf.cpp +++ b/src/zmf.cpp @@ -104,6 +104,8 @@ void Usage() int main( int argc, char *argv[] ) { + srand( getpid() * time( 0 ) ); + int id = -1; static struct option long_options[] = { diff --git a/src/zms.cpp b/src/zms.cpp index a8aa3e29c..041eb59b3 100644 --- a/src/zms.cpp +++ b/src/zms.cpp @@ -52,6 +52,8 @@ bool ValidateAccess( User *user, int mon_id ) int main( int argc, const char *argv[] ) { + srand( getpid() * time( 0 ) ); + enum { ZMS_MONITOR, ZMS_EVENT } source = ZMS_MONITOR; enum { ZMS_JPEG, ZMS_MPEG, ZMS_RAW, ZMS_ZIP, ZMS_SINGLE } mode = ZMS_JPEG; char format[32] = ""; diff --git a/src/zmu.cpp b/src/zmu.cpp index 61a648955..c51c1c3ed 100644 --- a/src/zmu.cpp +++ b/src/zmu.cpp @@ -138,6 +138,8 @@ bool ValidateAccess( User *user, int mon_id, int function ) int main( int argc, char *argv[] ) { + srand( getpid() * time( 0 ) ); + static struct option long_options[] = { {"device", 2, 0, 'd'}, {"monitor", 1, 0, 'm'},