[Spice-devel] [PATCH spice] server: Fix an incorrect time calculation.

Francois Gouget fgouget at codeweavers.com
Thu Jun 11 10:20:01 PDT 2015


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---

I don't see how this minus sign could be right...

 server/spice_timer_queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/spice_timer_queue.c b/server/spice_timer_queue.c
index 71de84a..d457845 100644
--- a/server/spice_timer_queue.c
+++ b/server/spice_timer_queue.c
@@ -233,7 +233,7 @@ unsigned int spice_timer_queue_get_timeout_ms(void)
     head_timer = SPICE_CONTAINEROF(head, SpiceTimer, active_link);
 
     clock_gettime(CLOCK_MONOTONIC, &now);
-    now_ms = ((int64_t)now.tv_sec * 1000) - (now.tv_nsec / 1000 / 1000);
+    now_ms = ((int64_t)now.tv_sec * 1000) + (now.tv_nsec / 1000 / 1000);
 
     return MAX(0, ((int64_t)head_timer->expiry_time - now_ms));
 }
-- 
2.1.4



More information about the Spice-devel mailing list