From owner-cvs-all Mon Feb 3 2:29:49 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 074BC37B405; Mon, 3 Feb 2003 02:29:49 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5389643FB1; Mon, 3 Feb 2003 02:29:48 -0800 (PST) (envelope-from ache@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h13ATmbv027138; Mon, 3 Feb 2003 02:29:48 -0800 (PST) (envelope-from ache@repoman.freebsd.org) Received: (from ache@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h13ATmVi027137; Mon, 3 Feb 2003 02:29:48 -0800 (PST) Message-Id: <200302031029.h13ATmVi027137@repoman.freebsd.org> From: "Andrey A. Chernov" Date: Mon, 3 Feb 2003 02:29:47 -0800 (PST) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/libkern random.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ache 2003/02/03 02:29:47 PST Modified files: sys/libkern random.c Log: Park & Miller PRNG can be safely initialized with any value but 0 and stuck at 0 as designed. Its BSD adaptation tries to fight it by mapping 0 to 2147483647 after calculation, but this method not works since 2147483647 seed returns to 0 again on the next interation. Instead of after calculation mapping, map 0 to another value _before_ calculation, so it never stucks. Revision Changes Path 1.8 +4 -2 src/sys/libkern/random.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message