comparison random.c @ 714:84157e435c52

Make sure "struct timeval" is initialised on OS X to avoid valgrind warnings
author Matt Johnston <matt@ucc.asn.au>
date Thu, 21 Mar 2013 21:23:34 +0800
parents 48e173a0c52b
children 73b6e5d8801b b07eb3dc23ec
comparison
equal deleted inserted replaced
713:e22d5f5f6e37 714:84157e435c52
215 #endif 215 #endif
216 216
217 pid = getpid(); 217 pid = getpid();
218 sha1_process(&hs, (void*)&pid, sizeof(pid)); 218 sha1_process(&hs, (void*)&pid, sizeof(pid));
219 219
220 // gettimeofday() doesn't completely fill out struct timeval on
221 // OS X (10.8.3), avoid valgrind warnings by clearing it first
222 memset(&tv, 0x0, sizeof(tv));
220 gettimeofday(&tv, NULL); 223 gettimeofday(&tv, NULL);
221 sha1_process(&hs, (void*)&tv, sizeof(tv)); 224 sha1_process(&hs, (void*)&tv, sizeof(tv));
222 225
223 clockval = clock(); 226 clockval = clock();
224 sha1_process(&hs, (void*)&clockval, sizeof(clockval)); 227 sha1_process(&hs, (void*)&clockval, sizeof(clockval));