diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2009-11-06 18:05:40 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2009-11-06 18:16:12 +0000 |
commit | 312891930180ba10bd9d65c3e47f92cf15a6dacd (patch) | |
tree | 57f38543929b44cfd76a80c207e23d987dbcaf07 /net.c | |
parent | 62e0596dbda6831f7f7a976c183373d5ff7a7584 (diff) | |
download | strace-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.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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); |