Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/uuid.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/uuid.cc b/source/blender/blenlib/intern/uuid.cc
index 0c381e5dcd2..247928893f3 100644
--- a/source/blender/blenlib/intern/uuid.cc
+++ b/source/blender/blenlib/intern/uuid.cc
@@ -40,7 +40,10 @@ UUID BLI_uuid_generate_random()
struct timespec ts;
timespec_get(&ts, TIME_UTC);
- rng.seed(ts.tv_nsec);
+ /* XOR the nanosecond and second fields, just in case the clock only has seconds resolution. */
+ uint64_t seed = ts.tv_nsec;
+ seed ^= ts.tv_sec;
+ rng.seed(seed);
return rng;
}();