mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
Use a random number to seed the random number generator. Goodby, Rush
Limbaugh. This should have already worked properly if random(4) has been initialized correctly, but it seems that this is frequently not the case. Instead, use the microsecond part of the current time as the seed.
This commit is contained in:
parent
a09ad79379
commit
8af732d13c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148325
@ -174,6 +174,7 @@ char *av[];
|
||||
#ifdef OK_TO_WRITE_DISK
|
||||
int fd;
|
||||
#endif /* OK_TO_WRITE_DISK */
|
||||
struct timeval now;
|
||||
|
||||
(void) setlocale(LC_ALL, "");
|
||||
|
||||
@ -183,7 +184,8 @@ char *av[];
|
||||
exit(find_matches() != 0);
|
||||
|
||||
init_prob();
|
||||
srandomdev();
|
||||
gettimeofday(&now, NULL);
|
||||
srandom(now.tv_usec);
|
||||
do {
|
||||
get_fort();
|
||||
} while ((Short_only && fortlen() > SLEN) ||
|
||||
|
Loading…
Reference in New Issue
Block a user