summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-04-23 10:14:28 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-04-23 10:14:28 +0000
commit848422bb7dafd25149d53667508d0b87ce65def5 (patch)
treec3cbad30edd60ebf55067d0263d9d0b2b07aaae4
parent931c04f1a8c451ca83dbaa4bcb457cf8476cf3e9 (diff)
Notes
-rw-r--r--lib/libc/stdlib/rand.c2
-rw-r--r--lib/libc/stdlib/random.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index 8de8ead79e7ba..314fb929c45e5 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;
}
}
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c
index a271669f50646..fb0aa07cd972f 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;
}