Author: kevlo
Date: Wed Aug 22 00:59:17 2012
New Revision: 239549
URL: http://svn.freebsd.org/changeset/base/239549

Log:
  MFC r239345:
  Make 'junk' volatile so that compilers won't be tempted to optimize
  
  Reviewed by:  ache

Modified:
  stable/9/lib/libc/stdlib/random.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/stdlib/random.c
==============================================================================
--- stable/9/lib/libc/stdlib/random.c   Tue Aug 21 23:55:29 2012        
(r239548)
+++ stable/9/lib/libc/stdlib/random.c   Wed Aug 22 00:59:17 2012        
(r239549)
@@ -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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to