From: Dmitry V. Levin Date: Fri, 23 Dec 2016 23:33:40 +0000 (+0000) Subject: Remove redundant casts of ptrace arguments X-Git-Tag: v4.16~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=857398e779c003d8006ce0460c36c247a54eaba5;p=strace Remove redundant casts of ptrace arguments * strace.c (maybe_switch_tcbs, trace): Do not cast ptrace 4th argument from pointer to long type. --- diff --git a/strace.c b/strace.c index 91589555..4659ddbd 100644 --- 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