]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Automerge cleanup
authorDave Hart <hart@ntp.org>
Fri, 15 Apr 2011 00:12:03 +0000 (00:12 +0000)
committerDave Hart <hart@ntp.org>
Fri, 15 Apr 2011 00:12:03 +0000 (00:12 +0000)
bk: 4da78d53qcH7Mr6d5-wGJWduV-a6sw

ChangeLog
sntp/libevent/event.c

index 4379f8157e780d00001c7dcfdd92beeab93be209..d6fae6cbc89507ee7061b2069ca49727d33e111b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Update embedded libevent to current 2.1 git HEAD.
 (4.2.7p151) 2011/04/14 Released by Harlan Stenn <stenn@ntp.org>
 * Detect vsnprintf() support for "%m" and disable our "%m" expansion.
 * Add --enable-c99-sprintf to configure args for -noopenssl variety of
index a6d56f065e5d9bd9a20e9f2165db94b0844a5143..0b631cf8d5d8f0a013c9f8edca0f7e9dbc461f27 100644 (file)
@@ -374,61 +374,6 @@ gettime(struct event_base *base, struct timeval *tp)
        return (evutil_gettimeofday(tp, NULL));
 }
 
-/** Set 'tp' to the current time according to 'base'.  We must hold the lock
- * on 'base'.  If there is a cached time, return it.  Otherwise, use
- * gettimeofday to find out the right time.
- * Return 0 on success, -1 on failure.
- */
-static int
-gettod(struct event_base *base, struct timeval *tp)
-{
-       EVENT_BASE_ASSERT_LOCKED(base);
-
-#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
-       if (base->tod_tv_cache.tv_sec) {
-               *tp = base->tod_tv_cache;
-               return (0);
-       }
-#else
-       if (base->tv_cache.tv_sec) {
-               *tp = base->tv_cache;
-               return (0);
-       }
-#endif
-
-       return (evutil_gettimeofday(tp, NULL));
-}
-
-int
-event_base_tv_cached(struct event_base *base, struct timeval *tv)
-{
-       int r;
-       if (!base) {
-               base = current_base;
-               if (!current_base) {
-#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
-                       if (use_monotonic) {
-                               struct timespec ts;
-
-                               if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
-                                       return (-1);
-
-                               tv->tv_sec = ts.tv_sec;
-                               tv->tv_usec = ts.tv_nsec / 1000;
-                               return (0);
-                       }
-#endif
-
-                       return evutil_gettimeofday(tv, NULL);
-               }
-       }
-
-       EVBASE_ACQUIRE_LOCK(base, th_base_lock);
-       r = gettime(base, tv);
-       EVBASE_RELEASE_LOCK(base, th_base_lock);
-       return r;
-}
-
 int
 event_base_gettimeofday_cached(struct event_base *base, struct timeval *tv)
 {
@@ -459,28 +404,15 @@ static inline void
 clear_time_cache(struct event_base *base)
 {
        base->tv_cache.tv_sec = 0;
-#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
-       base->tod_tv_cache.tv_sec = 0;
-#endif
 }
 
 /** Replace the cached time in 'base' with the current time. */
 static inline void
 update_time_cache(struct event_base *base)
 {
-       clear_time_cache(base);
-       if (base->flags & EVENT_BASE_FLAG_NO_CACHE_TIME)
-               return;
-
-#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
-       gettod(base, &base->tod_tv_cache);
-       if (use_monotonic)
+       base->tv_cache.tv_sec = 0;
+       if (!(base->flags & EVENT_BASE_FLAG_NO_CACHE_TIME))
                gettime(base, &base->tv_cache);
-       else
-               base->tv_cache = base->tod_tv_cache;
-#else
-       gettime(base, &base->tv_cache);
-#endif
 }
 
 struct event_base *