- 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:
Owen Clarke
2011-07-01 15:34:41 -04:00
committed by Paul Beckingham
parent 9f2c5a6190
commit 3b2e93f1a0
2 changed files with 19 additions and 57 deletions

View File

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