Changeset View
Changeset View
Standalone View
Standalone View
crypto/heimdal/lib/roken/rand.c
Show All 30 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
*/ | */ | ||||
#include "roken.h" | #include "roken.h" | ||||
void ROKEN_LIB_FUNCTION | void ROKEN_LIB_FUNCTION | ||||
rk_random_init(void) | rk_random_init(void) | ||||
{ | { | ||||
#if defined(HAVE_ARC4RANDOM) | #if defined(HAVE_ARC4RANDOM) | ||||
arc4random_stir(); | |||||
#elif defined(HAVE_SRANDOMDEV) | #elif defined(HAVE_SRANDOMDEV) | ||||
markm: Harmless #if could be removed and following #elif could be turned into if. | |||||
Done Inline ActionsRemoving this one would fall through to the srand(time()) case instead — not what we want. This one should be left alone. cem: Removing this one would fall through to the srand(time()) case instead — not what we want. | |||||
srandomdev(); | srandomdev(); | ||||
#elif defined(HAVE_RANDOM) | #elif defined(HAVE_RANDOM) | ||||
srandom(time(NULL)); | srandom(time(NULL)); | ||||
#else | #else | ||||
srand (time(NULL)); | srand (time(NULL)); | ||||
#endif | #endif | ||||
} | } |
Harmless #if could be removed and following #elif could be turned into if.