From: Nick Mathewson Date: Wed, 30 Dec 2009 18:50:52 +0000 (-0500) Subject: Fix test-ratelim compilation on Linux. X-Git-Tag: release-2.0.4-alpha~93^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=885b42734c2360e95b9acb7a5b202262f24b7626;p=libevent Fix test-ratelim compilation on Linux. I'd forgotten to include time.h, and to link against libm. --- diff --git a/test/Makefile.am b/test/Makefile.am index a58539cf..5d2eab77 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -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 \ diff --git a/test/test-ratelim.c b/test/test-ratelim.c index d252e946..845e7504 100644 --- a/test/test-ratelim.c +++ b/test/test-ratelim.c @@ -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();