]> granicus.if.org Git - strace/commitdiff
Use perror_func_msg instead of perror_msg where appropriate
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 15 Aug 2019 20:23:19 +0000 (20:23 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 15 Aug 2019 20:23:19 +0000 (20:23 +0000)
* 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.

linux/aarch64/set_scno.c
ucopy.c
upeek.c
upoke.c

index e2b5d8a2aba6337a2389ab1f7912f8e1f0805d0d..9dbf32758539e15b27fbd1130ea142b2bfa7a123 100644 (file)
@@ -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 b335c22940ba8b914b88abec929e0791708ffc6f..fa1bcd49b69bc00c4771ce2bf11018879bf44faa 100644 (file)
--- 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 0618f2701f90e530d9f349e91933f6da862eeab6..147006cd4125fc2a77fbc86fd6ee19efaf4f544b 100644 (file)
--- 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 ae532e4896e8004904eaa3f2970ff590e0dd9d34..0c2d290392fe3f3bd5f58c0a5c37de609fc44631 100644 (file)
--- 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;