summaryrefslogtreecommitdiffstats
path: root/server/spice_timer_queue.c
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2015-06-11 19:20:01 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-06-29 17:50:26 +0200
commita45ff74b3d1c202e32e29be5845100bd3dfc845b (patch)
tree9d1775c004c1000a6971072dc4118c28cfdfb85a /server/spice_timer_queue.c
parent4ad3025249c1daea55fa7c0322258796ecab99c4 (diff)
downloadspice-a45ff74b3d1c202e32e29be5845100bd3dfc845b.tar.gz
spice-a45ff74b3d1c202e32e29be5845100bd3dfc845b.tar.xz
spice-a45ff74b3d1c202e32e29be5845100bd3dfc845b.zip
server: Fix an incorrect time calculation.
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Diffstat (limited to 'server/spice_timer_queue.c')
-rw-r--r--server/spice_timer_queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/spice_timer_queue.c b/server/spice_timer_queue.c
index 71de84a3..d4578453 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));
}