summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorkevlo <kevlo@FreeBSD.org>2012-08-17 01:05:56 +0000
committerkevlo <kevlo@FreeBSD.org>2012-08-17 01:05:56 +0000
commit8552821dd88e330e868645a6e497a39ff200eddd (patch)
tree118c2bb5f215c2e0f550592a557a5dab7b2054d4 /lib/libc/stdlib
parent79e5034b600a9b0089aa1ad6bc5693025f54ec76 (diff)
downloadFreeBSD-src-8552821dd88e330e868645a6e497a39ff200eddd.zip
FreeBSD-src-8552821dd88e330e868645a6e497a39ff200eddd.tar.gz
Make 'junk' volatile so that compilers won't be tempted to optimize
Reviewed by: ache MFC after: 3 days
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c
index f7be4a7..baae078 100644
--- a/lib/libc/stdlib/random.c
+++ b/lib/libc/stdlib/random.c
@@ -315,7 +315,7 @@ srandomdev()
if (!done) {
struct timeval tv;
- unsigned long junk;
+ volatile unsigned long junk;
gettimeofday(&tv, NULL);
srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec ^ junk);
OpenPOWER on IntegriCloud