* libmisc/salt.c: In case gettimeofday() fails, get some entropy

from the PID.
This commit is contained in:
nekral-guest 2009-04-24 22:49:20 +00:00
parent 7646230de2
commit 0c571784a3
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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;
}
}