summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2012-09-17 23:20:54 +0000
committerDmitry V. Levin <ldv@altlinux.org>2012-09-28 01:13:10 +0000
commit9a71bcdab254e4cd93b8f1e93c659644eb70ea9b (patch)
tree5ba9cc5f184c9200c54bb6abe2a4ddeecc82e65f /util.c
parent4411a0ce304812ea2f4e5c33815f7148981af195 (diff)
downloadstrace-9a71bcdab254e4cd93b8f1e93c659644eb70ea9b.tar.gz
strace-9a71bcdab254e4cd93b8f1e93c659644eb70ea9b.tar.bz2
strace-9a71bcdab254e4cd93b8f1e93c659644eb70ea9b.tar.xz
Use perror_msg instead of perror
* signal.c (sys_sigreturn): Use perror_msg instead of perror. * strace.c (tprintf, tprints, detach, startup_attach): Likewise. * syscall.c (get_scno): Likewise. * util.c (umoven, umovestr): Likewise.
Diffstat (limited to 'util.c')
-rw-r--r--util.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/util.c b/util.c
index 9ca49b2..8254677 100644
--- a/util.c
+++ b/util.c
@@ -789,9 +789,10 @@ umoven(struct tcb *tcp, long addr, int len, char *laddr)
if (r < 0) {
if (errno == ENOSYS)
process_vm_readv_not_supported = 1;
- else if (errno != EINVAL && errno != ESRCH) /* EINVAL is seen if process is gone */
- /* strange... */
- perror("process_vm_readv");
+ else if (errno != EINVAL && errno != ESRCH)
+ /* EINVAL or ESRCH could be seen if process is gone,
+ * all the rest is strange and should be reported. */
+ perror_msg("%s", "process_vm_readv");
goto vm_readv_didnt_work;
}
return r;
@@ -899,9 +900,11 @@ umovestr(struct tcb *tcp, long addr, int len, char *laddr)
if (r < 0) {
if (errno == ENOSYS)
process_vm_readv_not_supported = 1;
- else if (errno != EINVAL && errno != ESRCH) /* EINVAL is seen if process is gone */
- /* strange... */
- perror("process_vm_readv");
+ else if (errno != EINVAL && errno != ESRCH)
+ /* EINVAL or ESRCH could be seen
+ * if process is gone, all the rest
+ * is strange and should be reported. */
+ perror_msg("%s", "process_vm_readv");
goto vm_readv_didnt_work;
}
if (memchr(local[0].iov_base, '\0', r))