server: Fix an incorrect time calculation.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
This commit is contained in:
Francois Gouget 2015-06-11 19:20:01 +02:00 committed by Christophe Fergeau
parent 4ad3025249
commit a45ff74b3d

View File

@ -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));
}