]> granicus.if.org Git - strace/commitdiff
Output diagnostics to stderr
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 2 Dec 2010 23:38:13 +0000 (23:38 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 3 Dec 2010 17:28:11 +0000 (17:28 +0000)
* syscall.c (get_scno): Output information about changes in
personality mode to stderr.  Reported by Pádraig Brady.

syscall.c

index a742571bb883c928cb01ab539e41309d2c6d2e6b..8fcd10bb315723365b306fda61560419fb9abf81 100644 (file)
--- 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]);
                }
        }