Make 'junk' volatile so that compilers won't be tempted to optimize

Reviewed by:	ache
MFC after:	3 days
This commit is contained in:
Kevin Lo 2012-08-17 01:05:56 +00:00
parent e682d02e12
commit 8437339e10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239345

View File

@ -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);