]> granicus.if.org Git - libevent/commitdiff
Fix test-ratelim compilation on Linux.
authorNick Mathewson <nickm@torproject.org>
Wed, 30 Dec 2009 18:50:52 +0000 (13:50 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 30 Dec 2009 18:50:52 +0000 (13:50 -0500)
I'd forgotten to include time.h, and to link against libm.

test/Makefile.am
test/test-ratelim.c

index a58539cfe5ebdf8f52ba5ebbd546a57ebc4d626c..5d2eab770741fa45676d70f17081d6776edee270 100644 (file)
@@ -18,7 +18,7 @@ test_weof_LDADD = ../libevent_core.la
 test_time_SOURCES = test-time.c
 test_time_LDADD = ../libevent_core.la
 test_ratelim_SOURCES = test-ratelim.c
-test_ratelim_LDADD = ../libevent_core.la
+test_ratelim_LDADD = ../libevent_core.la -lm
 
 regress_SOURCES = regress.c regress_buffer.c regress_http.c regress_dns.c \
        regress_rpc.c regress.gen.c regress.gen.h regress_et.c \
index d252e94691834ac0dbc5f01ea14240640fe2d615..845e7504908079fef22408f6d3e2a6f8b958ca68 100644 (file)
@@ -312,7 +312,11 @@ main(int argc, char **argv)
        cfg_connlimit *= ratio;
        cfg_grouplimit *= ratio;
 
-       srandom(time(NULL));
+       {
+               struct timeval tv;
+               evutil_gettimeofday(&tv, NULL);
+               srandom(tv.tv_usec);
+       }
 
        evthread_enable_lock_debuging();