From: Dmitry V. Levin Date: Mon, 20 Jul 2015 17:50:56 +0000 (+0000) Subject: capability.c: use printaddr and umove_or_printaddr X-Git-Tag: v4.11~355 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c70da7c15e71087ac7384166a0ea68cd28fe9506;p=strace capability.c: use printaddr and umove_or_printaddr * capability.c (get_cap_header): Use printaddr. (print_cap_data): Use printaddr and umove_or_printaddr. --- diff --git a/capability.c b/capability.c index d18d7264..0724f8d4 100644 --- a/capability.c +++ b/capability.c @@ -51,13 +51,8 @@ get_cap_header(struct tcb *tcp, unsigned long addr) static void print_cap_header(struct tcb *tcp, unsigned long addr, cap_user_header_t h) { - if (!addr) { - tprints("NULL"); - return; - } - - if (!h) { - tprintf("%#lx", addr); + if (!addr || !h) { + printaddr(addr); return; } @@ -86,14 +81,8 @@ print_cap_data(struct tcb *tcp, unsigned long addr, const cap_user_header_t h) struct user_cap_data_struct data[2]; unsigned int len; - if (!addr) { - tprints("NULL"); - return; - } - - if (!h || !verbose(tcp) || - (exiting(tcp) && syserror(tcp))) { - tprintf("%#lx", addr); + if (!addr || !h) { + printaddr(addr); return; } @@ -103,10 +92,8 @@ print_cap_data(struct tcb *tcp, unsigned long addr, const cap_user_header_t h) else len = 1; - if (umoven(tcp, addr, len * sizeof(data[0]), data) < 0) { - tprintf("%#lx", addr); + if (umoven_or_printaddr(tcp, addr, len * sizeof(data[0]), data)) return; - } tprints("{"); print_cap_bits(data[0].effective, len > 1 ? data[1].effective : 0);