diff --git a/ChangeLog b/ChangeLog index 0f98f82c..0cab3de7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-25 Nicolas François + + * libmisc/salt.c: In case gettimeofday() fails, get some entropy + from the PID. + 2009-04-25 Nicolas François * libmisc/setupenv.c: Prefer snprintf to sprintf, even if a small diff --git a/libmisc/salt.c b/libmisc/salt.c index 68126293..99233c68 100644 --- a/libmisc/salt.c +++ b/libmisc/salt.c @@ -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; } }