From: Dave Hart Date: Fri, 15 Apr 2011 00:12:03 +0000 (+0000) Subject: Automerge cleanup X-Git-Tag: NTP_4_2_7P152~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b120e78562dfefed89cb93e4058a94a280d64e0;p=thirdparty%2Fntp.git Automerge cleanup bk: 4da78d53qcH7Mr6d5-wGJWduV-a6sw --- diff --git a/ChangeLog b/ChangeLog index 4379f8157..d6fae6cbc 100644 --- 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 * Detect vsnprintf() support for "%m" and disable our "%m" expansion. * Add --enable-c99-sprintf to configure args for -noopenssl variety of diff --git a/sntp/libevent/event.c b/sntp/libevent/event.c index a6d56f065..0b631cf8d 100644 --- a/sntp/libevent/event.c +++ b/sntp/libevent/event.c @@ -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 *