From 5c334bdc5b6746eb6a2f1a9bb6b85098acb49bc9 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 18 Dec 2012 16:09:31 -0500
Subject: [PATCH] MAINT-1986: patch OPSDEV-111 fix (rev 9346b73d6843) from
 server-trunk

---
 indra/llcommon/lluuid.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp
index 3926a00b03a..0aaa50d231b 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;
-- 
GitLab