From 18527260ea1630f7788c53b276584bc6ca0fb06e Mon Sep 17 00:00:00 2001 From: ache <ache@FreeBSD.org> Date: Mon, 23 Apr 2001 10:14:28 +0000 Subject: srand*dev() fallback code: change ^getpid() to ^(getpid() << 16) to allow change of high word part too to produce more interesting seed distribution. --- lib/libc/stdlib/rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/stdlib/rand.c') diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c index 8de8ead..314fb92 100644 --- a/lib/libc/stdlib/rand.c +++ b/lib/libc/stdlib/rand.c @@ -130,7 +130,7 @@ sranddev() unsigned long junk; gettimeofday(&tv, NULL); - next = getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk; + next = (getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk; } } -- cgit v1.1