summaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 1146d02168..31eb4ac496 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -280,6 +280,15 @@ tor_gettimeofday_cache_set(const struct timeval *tv)
tor_assert(tv);
memcpy(&cached_time_hires, tv, sizeof(*tv));
}
+
+/** For testing: called post-fork to make libevent reinitialize
+ * kernel structures. */
+void
+tor_libevent_postfork(void)
+{
+ int r = event_reinit(tor_libevent_get_base());
+ tor_assert(r == 0);
+}
#endif
#endif