[Spice-devel] Bug fix for server on 32 bit systems

Alon Levy alevy at redhat.com
Fri Apr 27 01:30:01 PDT 2012


On Thu, Apr 26, 2012 at 12:12:09PM -0500, Jeremy White wrote:
> My display channels were instantly timing out; turns out that the implementation of red_now() doesn't work on my 32 bit system.
> 
> This patch should fix that.
> 
> Cheers,
> 
> Jeremy

> From 77b366c0d33befceb530c095be276c1e0e2146b7 Mon Sep 17 00:00:00 2001
> From: Jeremy White <jwhite at codeweavers.com>
> Date: Thu, 26 Apr 2012 12:09:50 -0500
> Subject: [PATCH] Force 64 bit multiplication on 32 bit systems; fixes a bug
>  where the server times out the display channel freakily
>  fast.
> 
> ---
>  server/red_worker.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 297b168..e341c00 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -4636,7 +4636,7 @@ static inline uint64_t red_now(void)
>  
>      clock_gettime(CLOCK_MONOTONIC, &time);
>  
> -    return time.tv_sec * 1000000000 + time.tv_nsec;
> +    return ((uint64_t) time.tv_sec) * 1000000000 + time.tv_nsec;

I wonder if 1000000000LL would have done the same thing.

>  }
>  
>  static int red_process_cursor(RedWorker *worker, uint32_t max_pipe_size, int *ring_is_empty)
> -- 
> 1.7.9.5
> 

> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel



More information about the Spice-devel mailing list