diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-02-15 14:58:52 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-02-15 14:58:52 +0100 |
commit | e015d2d331c75b912e3dd96532e2c31ae0e06554 (patch) | |
tree | 05e352a8b05cc718af2e57bbe9a3ac0a974a9bb6 /signal.c | |
parent | ae8643e671db5c574ecba6aa7fe9012f286dc257 (diff) | |
download | strace-e015d2d331c75b912e3dd96532e2c31ae0e06554.tar.gz strace-e015d2d331c75b912e3dd96532e2c31ae0e06554.tar.bz2 strace-e015d2d331c75b912e3dd96532e2c31ae0e06554.tar.xz |
Macroize conditional signed widening operation
* defs.h: Define widen_to_long() macro.
* signal.c (sys_kill): Use it instead of open-coding it.
(sys_tgkill): Use widen_to_long() on pids.
* resource.c (decode_rlimit): Formatting fix.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1117,13 +1117,10 @@ int sys_kill(struct tcb *tcp) { if (entering(tcp)) { - long pid = tcp->u_arg[0]; -#if SUPPORTED_PERSONALITIES > 1 - /* Sign-extend a 32-bit value when that's what it is. */ - if (current_wordsize < sizeof pid) - pid = (long) (int) pid; -#endif - tprintf("%ld, %s", pid, signame(tcp->u_arg[1])); + tprintf("%ld, %s", + widen_to_long(tcp->u_arg[0]), + signame(tcp->u_arg[1]) + ); } return 0; } @@ -1133,7 +1130,10 @@ sys_tgkill(struct tcb *tcp) { if (entering(tcp)) { tprintf("%ld, %ld, %s", - tcp->u_arg[0], tcp->u_arg[1], signame(tcp->u_arg[2])); + widen_to_long(tcp->u_arg[0]), + widen_to_long(tcp->u_arg[1]), + signame(tcp->u_arg[2]) + ); } return 0; } |