Bug #772
- Implemented custom uuid function that doesn't suffer from the precision and cyclic lack of randomness of the previous implementation. Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
committed by
Paul Beckingham
parent
9f2c5a6190
commit
3b2e93f1a0
12
src/main.cpp
12
src/main.cpp
@@ -42,23 +42,19 @@
|
||||
|
||||
Context context;
|
||||
|
||||
#ifdef HAVE_SRANDOM
|
||||
#define srand(x) srandom(x)
|
||||
#endif
|
||||
|
||||
int main (int argc, const char** argv)
|
||||
{
|
||||
// Set up randomness.
|
||||
#ifdef CYGWIN
|
||||
#ifdef HAVE_SRANDOM
|
||||
srandom (time (NULL));
|
||||
#else
|
||||
srand (time (NULL));
|
||||
#endif
|
||||
#else
|
||||
struct timeval tv;
|
||||
gettimeofday (&tv, NULL);
|
||||
#ifdef HAVE_SRANDOM
|
||||
srandom (tv.tv_usec);
|
||||
#else
|
||||
srand (tv.tv_usec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int status = 0;
|
||||
|
||||
Reference in New Issue
Block a user