]> granicus.if.org Git - strace/commitdiff
Fix decoding of timer id returned by timer_create
authorAndi Kleen <ak@linux.intel.com>
Mon, 13 Jun 2011 21:37:40 +0000 (21:37 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 13 Jun 2011 21:37:40 +0000 (21:37 +0000)
* time.c (sys_timer_create): The kernel returns a integer, not a
pointer for the timer id in the memory pointed to by timer_id.

time.c

diff --git a/time.c b/time.c
index 6d8755183d5412384ff9bb45b9c989a6c622726c..bd4f11e2358fe42be2a86d74b7d03dac61171d2d 100644 (file)
--- a/time.c
+++ b/time.c
@@ -823,12 +823,12 @@ sys_timer_create(struct tcb *tcp)
                printsigevent(tcp, tcp->u_arg[1]);
                tprintf(", ");
        } else {
-               void *p;
+               int timer_id;
 
-               if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &p) < 0)
+               if (syserror(tcp) || umove(tcp, tcp->u_arg[2], &timer_id) < 0)
                        tprintf("%#lx", tcp->u_arg[2]);
                else
-                       tprintf("{%p}", p);
+                       tprintf("{%d}", timer_id);
        }
        return 0;
 }