From 885b42734c2360e95b9acb7a5b202262f24b7626 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 30 Dec 2009 13:50:52 -0500 Subject: [PATCH] Fix test-ratelim compilation on Linux. I'd forgotten to include time.h, and to link against libm. --- test/Makefile.am | 2 +- test/test-ratelim.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) 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(); -- 2.40.0