X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmagic.c;h=4797f0b19fd636f09c357b786b3378c002519ebd;hp=7391b1405df8a52b7649bd3390f2f24bcd06afc1;hb=fcdd79cf516672a47a3dd24b8e01071763f62110;hpb=582900da7f716dac246e19278e6087bb889baf24 diff --git a/pppd/magic.c b/pppd/magic.c index 7391b14..4797f0b 100644 --- a/pppd/magic.c +++ b/pppd/magic.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: magic.c,v 1.4 1995/04/24 05:57:01 paulus Exp $"; +static char rcsid[] = "$Id: magic.c,v 1.5 1995/06/06 01:52:25 paulus Exp $"; #endif #include @@ -39,14 +39,17 @@ extern void srand48 __P((long)); * 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 and current time, currently. + * The current method uses the current hostid, current process ID + * and current time, currently. */ void magic_init() { long seed; + struct timeval t; - seed = gethostid() ^ time(NULL); + gettimeofday(&t, NULL); + seed = gethostid() ^ t.tv_sec ^ t.tv_usec ^ getpid(); srand48(seed); }