]> granicus.if.org Git - strace/commitdiff
Remove redundant casts of ptrace arguments
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 23 Dec 2016 23:33:40 +0000 (23:33 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 24 Dec 2016 14:58:41 +0000 (14:58 +0000)
* strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument
from pointer to long type.

strace.c

index 91589555aad71b1772a4179f2b4f30c86322e998..4659ddbd2ad516482a7c7c4639688b2bafbeaa3e 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2056,7 +2056,7 @@ maybe_switch_tcbs(struct tcb *tcp, const int pid)
        struct tcb *execve_thread;
        long old_pid = 0;
 
-       if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, (long) &old_pid) < 0)
+       if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, &old_pid) < 0)
                return tcp;
        /* Avoid truncation in pid2tcb() param passing */
        if (old_pid <= 0 || old_pid == pid)
@@ -2411,7 +2411,7 @@ trace(void)
                 * TODO: shouldn't we check for errno == EINVAL too?
                 * We can get ESRCH instead, you know...
                 */
-               stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, (long) &si) < 0;
+               stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, &si) < 0;
 #if USE_SEIZE
 show_stopsig:
 #endif