summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-12-18 16:09:31 -0500
committerNat Goodspeed <nat@lindenlab.com>2012-12-18 16:09:31 -0500
commit5c334bdc5b6746eb6a2f1a9bb6b85098acb49bc9 (patch)
treef5c63ea103e51d4f8b0763ef6cbe5db3a9a3727e
parentf08c5d95ac3f7461fc4accdbf880bd02b811fddc (diff)
MAINT-1986: patch OPSDEV-111 fix (rev 9346b73d6843) from server-trunk
-rw-r--r--indra/llcommon/lluuid.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp
index 3926a00b03..0aaa50d231 100644
--- a/indra/llcommon/lluuid.cpp
+++ b/indra/llcommon/lluuid.cpp
@@ -877,8 +877,14 @@ U32 LLUUID::getRandomSeed()
static unsigned char seed[16]; /* Flawfinder: ignore */
getNodeID(&seed[0]);
- seed[6]='\0';
- seed[7]='\0';
+
+ // Incorporate the pid into the seed to prevent
+ // processes that start on the same host at the same
+ // time from generating the same seed.
+ pid_t pid = LLApp::getPid();
+
+ seed[6]=(unsigned char)(pid >> 8);
+ seed[7]=(unsigned char)(pid);
getSystemTime((uuid_time_t *)(&seed[8]));
LLMD5 md5_seed;