[master] 4ae73a5b1 Use VTIM_timespec()

Poul-Henning Kamp phk at FreeBSD.org
Wed Oct 13 08:35:07 UTC 2021


commit 4ae73a5b19ec1fc87cc018c01757535667e33341
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Oct 13 08:30:19 2021 +0000

    Use VTIM_timespec()

diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index 71f7a4d98..27d4f9289 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -367,8 +367,7 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 
 	if (vsl_ts > vsl_to) {
 		struct timespec ts;
-		ts.tv_nsec = (long)(modf(vsl_ts - vsl_to, &t) * 1e9);
-		ts.tv_sec = (long)t;
+		ts = VTIM_timespec(vsl_ts - vsl_to);
 		i = pthread_cond_timedwait(&timebend_cv, &mtx, &ts);
 		assert(i == 0 || i == ETIMEDOUT);
 	}


More information about the varnish-commit mailing list