Author: kevlo Date: Fri Aug 17 01:05:56 2012 New Revision: 239345 URL: http://svn.freebsd.org/changeset/base/239345
Log: Make 'junk' volatile so that compilers won't be tempted to optimize Reviewed by: ache MFC after: 3 days Modified: head/lib/libc/stdlib/random.c Modified: head/lib/libc/stdlib/random.c ============================================================================== --- head/lib/libc/stdlib/random.c Fri Aug 17 00:49:29 2012 (r239344) +++ head/lib/libc/stdlib/random.c Fri Aug 17 01:05:56 2012 (r239345) @@ -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-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"