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

Christophe Fergeau cfergeau at redhat.com
Mon Jun 29 08:50:15 PDT 2015


On Thu, Jun 11, 2015 at 07:20:01PM +0200, Francois Gouget wrote:
> 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);

Good catch, ACK! (will push this patch and the CLOCK_GETTIME one right
after sending this mail).

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150629/c048ffce/attachment-0001.sig>


More information about the Spice-devel mailing list