From ec86c822a08d9e0d8ffac2a7683ecb087051145a Mon Sep 17 00:00:00 2001 From: Paweł Krawczyk Date: Fri, 19 Jun 2015 13:53:32 +0000 Subject: initialise the seed variable and update comments --- libtac/lib/magic.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libtac/lib/magic.c b/libtac/lib/magic.c index 5e27596..681c960 100644 --- a/libtac/lib/magic.c +++ b/libtac/lib/magic.c @@ -34,14 +34,12 @@ static int magic_initialised = 0; * magic_init - Initialize the magic number generator. * * Attempts to compute a random number seed which will not repeat. - * The current method uses the current hostid, current process ID - * and current time, currently. */ void magic_init() { struct stat statbuf; - long seed; + long seed = 0; struct timeval t; if (magic_initialised) @@ -56,7 +54,7 @@ magic_init() } } - // add the deterministic data in case urandom failed + // fallback gettimeofday(&t, NULL); seed ^= gethostid() ^ t.tv_sec ^ t.tv_usec ^ getpid(); -- cgit v1.2.3