[PATCH] nandtest: seed random generator properly
Artem Bityutskiy
dedekind1 at gmail.com
Thu Dec 1 04:05:48 EST 2011
On Wed, 2011-11-30 at 10:24 -0800, Brian Norris wrote:
> On Mon, Nov 28, 2011 at 11:30 PM, Jan Weitzel <J.Weitzel at phytec.de> wrote:
> > Brian Norris <computersforpeace at gmail.com> schrieb am 28.11.2011 19:11:52:
> >> + if (seed < 0)
> >> + seed = time(NULL);
> >> + srand(seed);
> >
> > So you loose all negative seeds.
>
> Well, srand() technically takes unsigned ints, so all seeds are
> technically positive. But that just means we're parsing and storing
> seeds wrong (not a big deal, really).
Brian, would you please send an incremental patch on top of Jan's which
I've pushed?
Artem.
More information about the linux-mtd
mailing list