Skip to content
Snippets Groups Projects
Commit 3ab017b1 authored by David Goulet's avatar David Goulet :panda_face:
Browse files

main: Don't rescan main loop events if not initialized


This is done because it makes our life easier with unit tests. Also, a rescan
on an uninitialized event list will result in a stacktrace.

Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
parent 3a47dfed
No related branches found
No related tags found
No related merge requests found
......@@ -1553,6 +1553,13 @@ rescan_periodic_events(const or_options_t *options)
{
tor_assert(options);
/* Avoid scanning the event list if we haven't initialized it yet. This is
* particularly useful for unit tests in order to avoid initializing main
* loop events everytime. */
if (!periodic_events_initialized) {
return;
}
int roles = get_my_roles(options);
for (int i = 0; periodic_events[i].name; ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment