From 312891930180ba10bd9d65c3e47f92cf15a6dacd Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Fri, 6 Nov 2009 18:05:40 +0000 Subject: [PATCH] Fix getsockopt decoding on architectures where sizeof(long) > sizeof(int) * net.c (sys_getsockopt): Optimize output a bit. Decode integer argument using printnum_int(), patch by Gabor Gombas. --- net.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/net.c b/net.c index 9d2b9f9e..a3ceb40f 100644 --- a/net.c +++ b/net.c @@ -1605,8 +1605,7 @@ sys_socketpair(struct tcb *tcp) } int -sys_getsockopt(tcp) -struct tcb *tcp; +sys_getsockopt(struct tcb *tcp) { if (entering(tcp)) { tprintf("%ld, ", tcp->u_arg[0]); @@ -1648,10 +1647,11 @@ struct tcb *tcp; tprintf("%lu", tcp->u_arg[2]); break; } + tprintf (", "); } else { int len; if (syserror(tcp) || umove (tcp, tcp->u_arg[4], &len) < 0) { - tprintf(", %#lx, %#lx", + tprintf("%#lx, %#lx", tcp->u_arg[3], tcp->u_arg[4]); return 0; } @@ -1667,7 +1667,7 @@ struct tcb *tcp; tcp->u_arg[3], &linger) < 0) break; - tprintf(", {onoff=%d, linger=%d}, " + tprintf("{onoff=%d, linger=%d}, " "[%d]", linger.l_onoff, linger.l_linger, @@ -1680,9 +1680,8 @@ struct tcb *tcp; break; } - 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); -- 2.50.1