[PATCH] Fix getsockopt() decoding on x86_64

Gabor Gombas gombasg at sztaki.hu
Sun Oct 25 11:34:24 UTC 2009


Hi!

If the argument is an "int", then do not try to print it as "long" since
that will produce garbage when sizeof(int) != sizeof(long).

Gabor

diff --git a/net.c b/net.c
index 9d2b9f9..974e2bb 100644
--- a/net.c
+++ b/net.c
@@ -1682,7 +1682,7 @@ struct tcb *tcp;
 
 		tprintf (", ");
 		if (len == sizeof (int)) {
-			printnum(tcp, tcp->u_arg[3], "%ld");
+			printnum_int(tcp, tcp->u_arg[3], "%d");
 		}
 		else {
 			printstr (tcp, tcp->u_arg[3], len);
-- 
1.6.5

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------




More information about the Strace-devel mailing list