mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
cherry-pick https://gerrit.lix.systems/c/lix/+/2100
Cherry-pick https://gerrit.lix.systems/c/lix/+/2100 This change fixes a potential concurrency failure when accessing random which is not thread safe. Co-authored-by: Lily Ballard <lily@ballards.net>
This commit is contained in:
parent
e22142e11a
commit
6aed9d877c
7 changed files with 35 additions and 37 deletions
|
|
@ -176,16 +176,6 @@ void initNix(bool loadConfig)
|
|||
now. In particular, store objects should be readable by
|
||||
everybody. */
|
||||
umask(0022);
|
||||
|
||||
/* Initialise the PRNG. */
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, 0);
|
||||
#ifndef _WIN32
|
||||
srandom(tv.tv_usec);
|
||||
#endif
|
||||
srand(tv.tv_usec);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue