From: Dmitry V. Levin Date: Sat, 7 Jan 2017 16:44:44 +0000 (+0000) Subject: Print hexadecimal integer in error diagnostics using %#x X-Git-Tag: v4.16~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=600457fa9dd8d4769cb61559432a213212fedb87;p=strace Print hexadecimal integer in error diagnostics using %#x The formerly used format string %x led to misleading output as there was no clear indication sometimes whether the printed integer was decimal or hexadecimal. * aio.c (startup_child, test_ptrace_seize): Print status using %#x format specifier instead of %x. --- diff --git a/strace.c b/strace.c index a337362e..653009b5 100644 --- a/strace.c +++ b/strace.c @@ -1409,7 +1409,8 @@ startup_child(char **argv) } if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { kill_save_errno(pid, SIGKILL); - perror_msg_and_die("Unexpected wait status %x", status); + perror_msg_and_die("Unexpected wait status %#x", + status); } } /* Else: NOMMU case, we have no way to sync. @@ -1522,8 +1523,8 @@ test_ptrace_seize(void) if (WIFSIGNALED(status)) { return; } - error_msg_and_die("%s: unexpected wait status %x", - __func__, status); + error_msg_and_die("%s: unexpected wait status %#x", + __func__, status); } } #else /* !USE_SEIZE */