From bdafa1a90569fb791af6abdffca109fee044d94e Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 2 Dec 2010 23:38:13 +0000 Subject: [PATCH] Output diagnostics to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * syscall.c (get_scno): Output information about changes in personality mode to stderr. Reported by Pádraig Brady. --- syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/syscall.c b/syscall.c index a742571b..8fcd10bb 100644 --- a/syscall.c +++ b/syscall.c @@ -889,7 +889,7 @@ get_scno(struct tcb *tcp) if (currpers != current_personality) { static const char *const names[] = {"64 bit", "32 bit"}; set_personality(currpers); - printf("[ Process PID=%d runs in %s mode. ]\n", + fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", pid, names[current_personality]); } } @@ -962,7 +962,7 @@ get_scno(struct tcb *tcp) call = ptrace(PTRACE_PEEKTEXT, pid, (char *)rip, (char *)0); if (errno) - printf("ptrace_peektext failed: %s\n", + fprintf(stderr, "ptrace_peektext failed: %s\n", strerror(errno)); switch (call & 0xffff) { /* x86-64: syscall = 0x0f 0x05 */ @@ -981,7 +981,7 @@ get_scno(struct tcb *tcp) if (currpers != current_personality) { static const char *const names[] = {"64 bit", "32 bit"}; set_personality(currpers); - printf("[ Process PID=%d runs in %s mode. ]\n", + fprintf(stderr, "[ Process PID=%d runs in %s mode. ]\n", pid, names[current_personality]); } } -- 2.40.0