* libmisc/salt.c: In case gettimeofday() fails, get some entropy
from the PID.
This commit is contained in:
parent
7646230de2
commit
0c571784a3
@ -1,3 +1,8 @@
|
||||
2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/salt.c: In case gettimeofday() fails, get some entropy
|
||||
from the PID.
|
||||
|
||||
2009-04-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/setupenv.c: Prefer snprintf to sprintf, even if a small
|
||||
|
@ -69,8 +69,8 @@ static void seedRNG (void)
|
||||
static int seeded = 0;
|
||||
|
||||
if (0 == seeded) {
|
||||
gettimeofday(&tv, NULL);
|
||||
srandom (tv.tv_sec + tv.tv_usec);
|
||||
(void) gettimeofday (&tv, NULL);
|
||||
srandom (tv.tv_sec ^ tv.tv_usec ^ getpid ());
|
||||
seeded = 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user