From: Dave Hart Date: Thu, 14 Jun 2012 22:43:34 +0000 (+0000) Subject: Merge dlh-7551.ad.hartbrothers.com:C:/ntp/ntp-dev-libevent-upstream X-Git-Tag: NTP_4_2_7P284~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b027ae112bb176fc958e22c58b49f4a634602d2;p=thirdparty%2Fntp.git Merge dlh-7551.ad.hartbrothers.com:C:/ntp/ntp-dev-libevent-upstream into dlh-7551.ad.hartbrothers.com:C:/ntp/ntp-dev-libevent-20120614 bk: 4fda6916cO-myLzn-aRlHngdHT7z0w --- 8b027ae112bb176fc958e22c58b49f4a634602d2 diff --cc sntp/libevent/Makefile.am index ca0895f6c,17d0a85d5..3a74e3327 --- a/sntp/libevent/Makefile.am +++ b/sntp/libevent/Makefile.am @@@ -88,10 -103,9 +103,10 @@@ EXTRA_DIST = autogen.sh \ event_rpcgen.py \ libevent.pc.in \ - Doxyfile \ - whatsnew-2.0.txt \ - Makefile.nmake test/Makefile.nmake \ + make-event-config.sed \ + m4/LICENSE-OPENLDAP \ + whatsnew-2.0.txt \ + whatsnew-2.1.txt \ $(PLATFORM_DEPENDENT_SRC) LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la diff --cc sntp/libevent/configure.in index e379fb10c,f1972bf63..5ec48918f --- a/sntp/libevent/configure.in +++ b/sntp/libevent/configure.in @@@ -4,13 -9,12 +9,13 @@@ AC_PREREQ(2.59 AC_INIT(event.c) AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR([build-aux]) - AM_INIT_AUTOMAKE(libevent,2.1.0-alpha-dev) + AM_INIT_AUTOMAKE(libevent,2.1.1-alpha-dev) dnl AM_SILENT_RULES req. automake 1.11. [no] defaults V=1 -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_CONFIG_HEADER(config.h evconfig-private.h:evconfig-private.h.in) - AC_DEFINE(NUMERIC_VERSION, 0x02010001, [Numeric representation of the version]) + AC_DEFINE(NUMERIC_VERSION, 0x02010101, [Numeric representation of the version]) dnl Initialize prefix. if test "$prefix" = "NONE"; then diff --cc sntp/libevent/event.c index 89e05b3ee,c5c118cc1..e914dcf3c --- a/sntp/libevent/event.c +++ b/sntp/libevent/event.c @@@ -424,9 -405,25 +405,25 @@@ update_time_cache(struct event_base *ba { base->tv_cache.tv_sec = 0; if (!(base->flags & EVENT_BASE_FLAG_NO_CACHE_TIME)) - gettime(base, &base->tv_cache); + gettime(base, &base->tv_cache); } + int + event_base_update_cache_time(struct event_base *base) + { + + if (!base) { + base = current_base; + if (!current_base) + return -1; + } + + EVBASE_ACQUIRE_LOCK(base, th_base_lock); + update_time_cache(base); + EVBASE_RELEASE_LOCK(base, th_base_lock); + return 0; + } + struct event_base * event_init(void) { diff --cc sntp/libevent/http.c index 95588832d,786105d37..969e41f58 --- a/sntp/libevent/http.c +++ b/sntp/libevent/http.c @@@ -54,16 -54,13 +54,16 @@@ #include - #ifdef _EVENT_HAVE_NETINET_IN_H + #ifdef EVENT__HAVE_NETINET_IN_H #include +# ifdef _XOPEN_SOURCE_EXTENDED +# include +# endif #endif - #ifdef _EVENT_HAVE_ARPA_INET_H + #ifdef EVENT__HAVE_ARPA_INET_H #include #endif - #ifdef _EVENT_HAVE_NETDB_H + #ifdef EVENT__HAVE_NETDB_H #include #endif diff --cc sntp/libevent/include/event2/event.h index 137bc6a0b,cf358c03f..7db1bfe9e --- a/sntp/libevent/include/event2/event.h +++ b/sntp/libevent/include/event2/event.h @@@ -1206,30 -1288,25 +1288,40 @@@ void event_set_mem_functions #define EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED #endif + /** + Writes a human-readable description of all inserted and/or active + events to a provided stdio stream. + + This is intended for debugging; its format is not guaranteed to be the same + between libevent versions. + + @param base An event_base on which to scan the events. + @param output A stdio file to write on. + */ void event_base_dump_events(struct event_base *, FILE *); -/** Sets 'tv' to the current time (as returned by gettimeofday()), +/** Sets 'tv' to the internal time (used for timeout scheduling), looking at the cached value in 'base' if possible, and calling gettimeofday() or clock_gettime() as appropriate if there is no - cached time. + cached time. If clock_gettime(CLOCK_MONOTONIC) is being used + internally, the tv_sec of internal times represent system uptime + rather than time since UNIX epoch. + + Generally, this value will only be cached while actually + processing event callbacks, and may be very inaccurate if your + callbacks take a long time to execute. + + Returns 0 on success, negative on failure. + */ +int event_base_tv_cached(struct event_base *base, + struct timeval *tv); + +/** Sets 'tv' to the current time (as returned by gettimeofday()), + looking at the cached value in 'base' if possible, and calling + gettimeofday() if there is no cached time. Generally, this value will only be cached while actually - processing event callbacks, and may be very inaccuate if your + processing event callbacks, and may be very inaccurate if your callbacks take a long time to execute. Returns 0 on success, negative on failure.