* 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

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