diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-08-17 01:05:56 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-08-17 01:05:56 +0000 |
commit | 8552821dd88e330e868645a6e497a39ff200eddd (patch) | |
tree | 118c2bb5f215c2e0f550592a557a5dab7b2054d4 /lib/libc | |
parent | 79e5034b600a9b0089aa1ad6bc5693025f54ec76 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | lib/libc/stdlib/random.c | 2 |
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); |