diff src/c/urweb.c @ 2105:882556b3029d

Fix silly mistake from last commit; also switch away from rand() in openssl.c
author Adam Chlipala <adam@chlipala.net>
date Thu, 22 Jan 2015 09:46:20 -0500
parents 7755f00a4fc3
children 4895c41b2ec6 e10881cd92da
line wrap: on
line diff
--- a/src/c/urweb.c	Mon Jan 12 12:02:54 2015 -0500
+++ b/src/c/urweb.c	Thu Jan 22 09:46:20 2015 -0500
@@ -171,11 +171,11 @@
 
 static uw_Basis_int my_rand() {
   pthread_mutex_lock(&rand_mutex);
-  int r = RAND_bytes((unsigned char *)&ret, sizeof ret);
+  int ret, r = RAND_bytes((unsigned char *)&ret, sizeof ret);
   pthread_mutex_unlock(&rand_mutex);
 
   if (r)
-    return abs(r);
+    return abs(ret);
   else
     return -1;
 }
@@ -362,8 +362,6 @@
 extern void uw_init_crypto();
 
 void uw_global_init() {
-  srand(time(NULL) ^ getpid());
-
   clients = malloc(0);
 
   uw_global_custom();