From 825126c7fa26d1f34e35f6c598293f1dc522ee08 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 20 May 2003 22:57:28 +0000 Subject: [PATCH] random # seed for results svn path=/trunk/boinc/; revision=1227 --- tools/backend_lib.C | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/backend_lib.C b/tools/backend_lib.C index cc4401c86a..832058570b 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -20,6 +20,7 @@ #include #include #include +#include #include "boinc_db.h" #include "crypt.h" @@ -178,7 +179,12 @@ int create_result( char base_outfile_name[256]; char result_template_copy[MAX_BLOB_SIZE]; int retval; + static bool rand_init = false; + if (!rand_init) { + rand_init = true; + srand48(getpid() + time(0)); + } memset(&r, 0, sizeof(r)); initialize_result(r, wu); sprintf(r.name, "%s_%s", wu.name, result_name_suffix);