summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-07-13 09:28:46 -0400
committerNick Mathewson <nickm@torproject.org>2016-07-19 11:40:47 +0200
commit7bc4ca7de9d434edeb21525917c81d6963a26511 (patch)
treef7d3b1f8e1375aa22e59a5b5d8f9d2619f92e5ca
parentc7558c906a1069308f8f4519b8c93245fbca9efd (diff)
downloadtor-7bc4ca7de9d434edeb21525917c81d6963a26511.tar.gz
tor-7bc4ca7de9d434edeb21525917c81d6963a26511.zip
Remove tor_gettimeofday_cached_monotonic as broken and unneeded
-rw-r--r--src/common/compat_libevent.c30
-rw-r--r--src/common/compat_libevent.h1
2 files changed, 0 insertions, 31 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index c5f73dc51a..4dab54493f 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -388,33 +388,3 @@ tor_gettimeofday_cache_set(const struct timeval *tv)
#endif
#endif
-/**
- * As tor_gettimeofday_cached, but can never move backwards in time.
- *
- * The returned value may diverge from wall-clock time, since wall-clock time
- * can trivially be adjusted backwards, and this can't. Don't mix wall-clock
- * time with these values in the same calculation.
- *
- * Depending on implementation, this function may or may not "smooth out" huge
- * jumps forward in wall-clock time. It may or may not keep its results
- * advancing forward (as opposed to stalling) if the wall-clock time goes
- * backwards. The current implementation does neither of of these.
- *
- * This function is not thread-safe; do not call it outside the main thread.
- *
- * In future versions of Tor, this may return a time does not have its
- * origin at the Unix epoch.
- */
-void
-tor_gettimeofday_cached_monotonic(struct timeval *tv)
-{
- struct timeval last_tv = { 0, 0 };
-
- tor_gettimeofday_cached(tv);
- if (timercmp(tv, &last_tv, OP_LT)) {
- memcpy(tv, &last_tv, sizeof(struct timeval));
- } else {
- memcpy(&last_tv, tv, sizeof(struct timeval));
- }
-}
-
diff --git a/src/common/compat_libevent.h b/src/common/compat_libevent.h
index 89b35c9faa..e64095bbfa 100644
--- a/src/common/compat_libevent.h
+++ b/src/common/compat_libevent.h
@@ -70,7 +70,6 @@ void tor_gettimeofday_cache_clear(void);
#ifdef TOR_UNIT_TESTS
void tor_gettimeofday_cache_set(const struct timeval *tv);
#endif
-void tor_gettimeofday_cached_monotonic(struct timeval *tv);
#ifdef COMPAT_LIBEVENT_PRIVATE