[master] 4dfcedb Fix mgt uptime counter when suspended

Martin Blix Grydeland martin at varnish-cache.org
Tue Oct 1 14:48:19 CEST 2013


commit 4dfcedbde56df0a6ccfa1d096bf6bed61a0d0f5b
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Sep 30 17:12:24 2013 +0200

    Fix mgt uptime counter when suspended
    
    Use VTIM_real instead of VTIM_mono for mgt uptime so that the time
    won't stop counting when the computer is suspended.

diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index aa66c5a..2f81db1 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -694,7 +694,7 @@ mgt_uptime(const struct vev *e, int what)
 	(void)what;
 	AN(VSC_C_mgt);
 	VSC_C_mgt->uptime = static_VSC_C_mgt.uptime =
-	    VTIM_mono() - mgt_uptime_t0;
+	    VTIM_real() - mgt_uptime_t0;
 	if (heritage.vsm != NULL)
 		VSM_common_ageupdate(heritage.vsm);
 	return (0);
@@ -713,7 +713,7 @@ MGT_Run(void)
 	struct vev *e;
 	int i;
 
-	mgt_uptime_t0 = VTIM_mono();
+	mgt_uptime_t0 = VTIM_real();
 	e = vev_new();
 	XXXAN(e);
 	e->callback = mgt_uptime;



More information about the varnish-commit mailing list