[PATCH] Fix decoding of timer_id for timer_create

Dmitry V. Levin ldv at altlinux.org
Mon Jun 20 21:30:10 UTC 2011


On Fri, Jun 10, 2011 at 01:06:15PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak at linux.intel.com>
> 
> The kernel returns a integer, not a pointer for the timer id
> in the memory pointed to by timer_id.
> strace used a pointer, which added random junk on a 64bit system.
> Fix it to be an integer.
> ---
>  time.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/time.c b/time.c
> index 0c6deaf..ac366fb 100644
> --- a/time.c
> +++ b/time.c
> @@ -838,12 +838,12 @@ struct tcb *tcp;
>  		printsigevent(tcp, tcp->u_arg[1]);
>  		tprintf(", ");
>  	} else {
> -		void *p;
> +		int p;
>  
>  		if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &p) < 0)
>  			tprintf("%#lx", tcp->u_arg[2]);
>  		else
> -			tprintf("{%p}", p);
> +			tprintf("{%u}", p);
>  	}
>  	return 0;
>  }

Thanks, changed "int p" to less confusing "int timer_id" and applied.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20110621/266fcc0f/attachment.bin>


More information about the Strace-devel mailing list