aboutsummaryrefslogtreecommitdiff
path: root/src/lib/wallclock/approx_time.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-11-09 15:01:49 -0500
committerNick Mathewson <nickm@torproject.org>2018-11-09 15:01:49 -0500
commitbf4f55a13da783083b0c76decd6ebf475a63ebd0 (patch)
tree15ebd3463fc900d52cd3065b6c83cf83a364e3e7 /src/lib/wallclock/approx_time.c
parent5d73f87cedaf58fd6e7a53a230b311f5e8b51b73 (diff)
parent60d10812368458cb88aa9f9d628c49766d4bb490 (diff)
downloadtor-bf4f55a13da783083b0c76decd6ebf475a63ebd0.tar.gz
tor-bf4f55a13da783083b0c76decd6ebf475a63ebd0.zip
Merge branch 'subsystems'
Diffstat (limited to 'src/lib/wallclock/approx_time.c')
-rw-r--r--src/lib/wallclock/approx_time.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/wallclock/approx_time.c b/src/lib/wallclock/approx_time.c
index bb9a292369..0b0ef382c2 100644
--- a/src/lib/wallclock/approx_time.c
+++ b/src/lib/wallclock/approx_time.c
@@ -9,7 +9,9 @@
**/
#include "orconfig.h"
+#include "lib/subsys/subsys.h"
#include "lib/wallclock/approx_time.h"
+#include "lib/wallclock/wallclock_sys.h"
/* =====
* Cached time
@@ -41,3 +43,17 @@ update_approx_time(time_t now)
cached_approx_time = now;
}
#endif /* !defined(TIME_IS_FAST) */
+
+static int
+subsys_wallclock_initialize(void)
+{
+ update_approx_time(time(NULL));
+ return 0;
+}
+
+const subsys_fns_t sys_wallclock = {
+ .name = "wallclock",
+ .supported = true,
+ .level = -99,
+ .initialize = subsys_wallclock_initialize,
+};