From 848422bb7dafd25149d53667508d0b87ce65def5 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" 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/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/stdlib/random.c') diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index a271669f5064..fb0aa07cd972 100644 --- a/lib/libc/stdlib/random.c +++ b/lib/libc/stdlib/random.c @@ -312,7 +312,7 @@ srandomdev() unsigned long junk; gettimeofday(&tv, NULL); - srandom(getpid() ^ tv.tv_sec ^ tv.tv_usec ^ junk); + srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk); return; } -- cgit v1.2.3