summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2009-11-06 18:05:40 +0000
committerDmitry V. Levin <ldv@altlinux.org>2009-11-06 18:16:12 +0000
commit312891930180ba10bd9d65c3e47f92cf15a6dacd (patch)
tree57f38543929b44cfd76a80c207e23d987dbcaf07 /net.c
parent62e0596dbda6831f7f7a976c183373d5ff7a7584 (diff)
downloadstrace-312891930180ba10bd9d65c3e47f92cf15a6dacd.tar.gz
strace-312891930180ba10bd9d65c3e47f92cf15a6dacd.tar.bz2
strace-312891930180ba10bd9d65c3e47f92cf15a6dacd.tar.xz
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.
Diffstat (limited to 'net.c')
-rw-r--r--net.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net.c b/net.c
index 9d2b9f9..a3ceb40 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);