summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2019-08-15 20:23:19 +0000
committerDmitry V. Levin <ldv@altlinux.org>2019-08-15 20:23:19 +0000
commita8dc094bd432a28df6b0418b7140b2467bc078bf (patch)
treef555d6d2a650ddaad49bc62b06442abea244d190
parent2b3d59c14b0801cd1454d3bb383be7fe333e68b0 (diff)
downloadstrace-a8dc094bd432a28df6b0418b7140b2467bc078bf.tar.gz
Use perror_func_msg instead of perror_msg where appropriate
* linux/aarch64/set_scno.c (arch_set_scno): Use perror_func_msg instead of perror_msg. * ucopy.c (umoven_peekdata, umoven, umovestr_peekdata, umovestr): Likewise. * upeek.c (upeek): Likewise. * upoke.c (upoke): Likewise.
-rw-r--r--linux/aarch64/set_scno.c4
-rw-r--r--ucopy.c32
-rw-r--r--upeek.c7
-rw-r--r--upoke.c4
4 files changed, 25 insertions, 22 deletions
diff --git a/linux/aarch64/set_scno.c b/linux/aarch64/set_scno.c
index e2b5d8a2a..9dbf32758 100644
--- a/linux/aarch64/set_scno.c
+++ b/linux/aarch64/set_scno.c
@@ -23,7 +23,7 @@ arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
};
int rc = ptrace(PTRACE_SETREGSET, tcp->pid, NT_ARM_SYSTEM_CALL, &io);
if (rc && errno != ESRCH)
- perror_msg("arch_set_scno: NT_ARM_SYSTEM_CALL pid:%d scno:%#x",
- tcp->pid, n);
+ perror_func_msg("NT_ARM_SYSTEM_CALL pid:%d scno:%#x",
+ tcp->pid, n);
return rc;
}
diff --git a/ucopy.c b/ucopy.c
index b335c2294..fa1bcd49b 100644
--- a/ucopy.c
+++ b/ucopy.c
@@ -106,14 +106,16 @@ umoven_peekdata(const int pid, kernel_ulong_t addr, unsigned int len,
case EFAULT: case EIO: case EPERM:
/* address space is inaccessible */
if (nread) {
- perror_msg("umoven: short read (%u < %u) @0x%" PRI_klx,
- nread, nread + len, addr - nread);
+ perror_func_msg("short read (%u < %u)"
+ " @0x%" PRI_klx,
+ nread, nread + len,
+ addr - nread);
}
return -1;
default:
/* all the rest is strange and should be reported */
- perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx,
- pid, addr);
+ perror_func_msg("pid:%d @0x%" PRI_klx,
+ pid, addr);
return -1;
}
@@ -166,8 +168,7 @@ umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
return -1;
default:
/* all the rest is strange and should be reported */
- perror_msg("process_vm_readv: pid:%d @0x%" PRI_klx,
- pid, addr);
+ perror_func_msg("pid:%d @0x%" PRI_klx, pid, addr);
return -1;
}
}
@@ -202,14 +203,16 @@ umovestr_peekdata(const int pid, kernel_ulong_t addr, unsigned int len,
case EFAULT: case EIO: case EPERM:
/* address space is inaccessible */
if (nread) {
- perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx,
- nread, nread + len, addr - nread);
+ perror_func_msg("short read (%d < %d)"
+ " @0x%" PRI_klx,
+ nread, nread + len,
+ addr - nread);
}
return -1;
default:
/* all the rest is strange and should be reported */
- perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx,
- pid, addr);
+ perror_func_msg("pid:%d @0x%" PRI_klx,
+ pid, addr);
return -1;
}
@@ -289,16 +292,17 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len,
case EFAULT: case EIO:
/* address space is inaccessible */
if (nread)
- perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx,
- nread, nread + len, addr - nread);
+ perror_func_msg("short read (%d < %d)"
+ " @0x%" PRI_klx,
+ nread, nread + len,
+ addr - nread);
return -1;
case ESRCH:
/* the process is gone */
return -1;
default:
/* all the rest is strange and should be reported */
- perror_msg("process_vm_readv: pid:%d @0x%" PRI_klx,
- pid, addr);
+ perror_func_msg("pid:%d @0x%" PRI_klx, pid, addr);
return -1;
}
}
diff --git a/upeek.c b/upeek.c
index 0618f2701..147006cd4 100644
--- a/upeek.c
+++ b/upeek.c
@@ -23,10 +23,9 @@ upeek(struct tcb *tcp, unsigned long off, kernel_ulong_t *res)
errno = 0;
val = ptrace(PTRACE_PEEKUSER, (pid_t) tcp->pid, (void *) off, 0);
if (val == -1 && errno) {
- if (errno != ESRCH) {
- perror_msg("upeek: PTRACE_PEEKUSER pid:%d @0x%lx)",
- tcp->pid, off);
- }
+ if (errno != ESRCH)
+ perror_func_msg("PTRACE_PEEKUSER pid:%d @0x%lx)",
+ tcp->pid, off);
return -1;
}
*res = (unsigned long) val;
diff --git a/upoke.c b/upoke.c
index ae532e489..0c2d29039 100644
--- a/upoke.c
+++ b/upoke.c
@@ -15,8 +15,8 @@ upoke(struct tcb *tcp, unsigned long off, kernel_ulong_t val)
{
if (ptrace_pokeuser(tcp->pid, off, val) < 0) {
if (errno != ESRCH)
- perror_msg("upoke: PTRACE_POKEUSER pid:%d @%#lx)",
- tcp->pid, off);
+ perror_func_msg("PTRACE_POKEUSER pid:%d @%#lx)",
+ tcp->pid, off);
return -1;
}
return 0;