aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-11-17 09:26:50 -0500
committerNick Mathewson <nickm@torproject.org>2015-11-17 09:26:50 -0500
commit70f337fdb20f5ce378e1bfb936aa63a40cdcacaa (patch)
tree974a7941340830e510beef8b6d713959f3ca7830 /src/or/main.c
parentb91bd27e6f94e76359097e1ec53494ea5168108d (diff)
downloadtor-70f337fdb20f5ce378e1bfb936aa63a40cdcacaa.tar.gz
tor-70f337fdb20f5ce378e1bfb936aa63a40cdcacaa.zip
Some unit tests now require that periodic events be initialized.
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c
index afcb313574..b63b81eb7e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1352,12 +1352,17 @@ initialize_periodic_events_cb(evutil_socket_t fd, short events, void *data)
/** Set up all the members of periodic_events[], and configure them all to be
* launched from a callback. */
-static void
+STATIC void
initialize_periodic_events(void)
{
tor_assert(periodic_events_initialized == 0);
periodic_events_initialized = 1;
+ int i;
+ for (i = 0; periodic_events[i].name; ++i) {
+ periodic_event_setup(&periodic_events[i]);
+ }
+
#define NAMED_CALLBACK(name) \
STMT_BEGIN name ## _event = find_periodic_event( #name ); STMT_END
@@ -1372,7 +1377,7 @@ initialize_periodic_events(void)
&one_second);
}
-static void
+STATIC void
teardown_periodic_events(void)
{
int i;