[master] a2d0b594a Polish
Nils Goroll
nils.goroll at uplex.de
Sat Oct 6 14:48:39 UTC 2018
The previous logic set USE_GETHRTIME to 0 when it was not to be used.
Now the logic does not match the test program any more.
On 06/10/2018 16:13, Federico G. Schwindt wrote:
>
> commit a2d0b594afd73b6c472a25cf3eb01c88e00cc9b7
> Author: Federico G. Schwindt <fgsch at lodoss.net>
> Date: Fri Oct 5 14:07:03 2018 +0100
>
> Polish
>
> diff --git a/configure.ac b/configure.ac
> index 169325892..204519b3b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -355,7 +355,6 @@ AC_CHECK_FUNCS([clock_gettime])
> AC_CHECK_FUNCS([gethrtime])
> LIBS="${save_LIBS}"
>
> -AC_DEFINE([USE_GETHRTIME], [1], [whether to use gethrtime])
> if test "x$ac_cv_func_gethrtime" = xyes && \
> test "x$ac_cv_func_clock_gettime" = xyes ; then
> AC_MSG_CHECKING(if clock_gettime is faster than gethrtime)
> @@ -405,9 +404,9 @@ static hrtime_t cl()
> return (1);
> ]])],
> [AC_MSG_RESULT(yes)
> - AC_DEFINE([USE_GETHRTIME], [0], [whether to use gethrtime])
> ],
> [AC_MSG_RESULT(no)
> + AC_DEFINE([USE_GETHRTIME], [1], [Define if gethrtime is preferred])
> ]
> )
> fi
> diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
> index 39d5ca342..5c6503c7e 100644
> --- a/lib/libvarnish/vtim.c
> +++ b/lib/libvarnish/vtim.c
> @@ -127,14 +127,14 @@ init(void)
> double
> VTIM_mono(void)
> {
> -#if defined(HAVE_GETHRTIME) && USE_GETHRTIME
> - return (gethrtime() * 1e-9);
> -#elif HAVE_CLOCK_GETTIME
> +#if defined(HAVE_CLOCK_GETTIME) && !defined(USE_GETHRTIME)
> struct timespec ts;
>
> AZ(clock_gettime(CLOCK_MONOTONIC, &ts));
> return (ts.tv_sec + 1e-9 * ts.tv_nsec);
> -#elif defined(__MACH__)
> +#elif defined(HAVE_GETHRTIME)
> + return (gethrtime() * 1e-9);
> +#elif defined(__MACH__)
> uint64_t mt = mach_absolute_time() - mt_base;
>
> return (mt * mt_scale);
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
>
--
** * * UPLEX - Nils Goroll Systemoptimierung
Scheffelstraße 32
22301 Hamburg
tel +49 40 28805731
mob +49 170 2723133
fax +49 40 42949753
xmpp://slink@jabber.int.uplex.de/
http://uplex.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-commit/attachments/20181006/fba3b9e4/attachment.bin>
More information about the varnish-commit
mailing list