Re: cvs commit: src/games/fortune/fortune fortune.c

From: Doug Barton <dougb_at_FreeBSD.org>
Date: Sat, 23 Jul 2005 12:28:02 -0700
M. Warner Losh wrote:
> In message: <20050723064449.GZ842_at_wantadilla.lemis.com>
>             "Greg 'groggy' Lehey" <grog_at_frg. eebsd.org> writes:
> : You should take a look at what I committed.  It simply uses the
> : microsecond value returned by getlocaltime() for the automatic seeding
> : by srandomdev().  It fixes the problem.  I can see only two
> : explanations:
> : 
> : 1.  srandomdev(), random(4) or friends are broken.
> : 2.  random(4) has been initialized incorrectly.
> : 
> : Currently I'm guessing (2), but I don't care much either way.
> 
> When sradnomdev() is broken, *DO*NOT* kludge around them by committing
> half-baked "fixes" like you did. 

I agree with you in principal Warner, but it's not at all clear that the 
real problem is srandomdev(). For instance, I just took a look at my laptop 
and noticed that there was still an old version of the fortunes2 file in 
/usr/share/games/fortune. The first fortune in that file is the one that I 
have been seeing with much greater frequency than the others, so I deleted 
those old files and we'll see what happens from here.

I also changed my fortune invocation in my shell startup file to:

/usr/games/fortune -D -D -D -sa 2>$HOME/fortune-debug
sysctl kern.random.sys.seeded >> $HOME/fortune-debug

Hopefully that will tell us something interesting.

Doug

-- 

     This .signature sanitized for your protection
Received on Sat Jul 23 2005 - 17:28:06 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:39 UTC