Tighten up the random seeding a little bit more. getpid() alone only
affect only lower bits of seed which would resulte in the same seed for sequences of fast-started awk's resulting the same random sequence. Submitted by: ache
This commit is contained in:
parent
5daeec1454
commit
9c23373c4e
@ -1509,7 +1509,8 @@ do_srand(NODE *tree)
|
||||
|
||||
if (tree == NULL)
|
||||
#ifdef __FreeBSD__
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0) ^ getpid()));
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0)
|
||||
^ (getpid() << 16)));
|
||||
#else
|
||||
srandom((unsigned int) (save_seed = (long) time((time_t *) 0)));
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user