From: Eugene Syromyatnikov Date: Sun, 10 Feb 2019 23:57:38 +0000 (+0100) Subject: ptrace_restart: do not print diagnostics when ptrace returns ESRCH X-Git-Tag: v5.0~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0632590bdc041ef937ecf0491d6cd1504dec36f;p=strace ptrace_restart: do not print diagnostics when ptrace returns ESRCH After some discussion, it was decided that the situation when the tracee is gone does not worth reporting. * strace.c (ptrace_restart): Return early if ptrace returned ESRCH. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1662936 --- diff --git a/strace.c b/strace.c index e083cc3c..ce89d5cd 100644 --- a/strace.c +++ b/strace.c @@ -366,7 +366,7 @@ ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig) errno = 0; ptrace(op, tcp->pid, 0L, (unsigned long) sig); err = errno; - if (!err) + if (!err || err == ESRCH) return 0; /* @@ -383,8 +383,6 @@ ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig) tcp->pid, ptrace_op_str(op), strerror(err)); line_ended(); } - if (err == ESRCH) - return 0; errno = err; perror_msg("ptrace(%s,pid:%d,sig:%u)", ptrace_op_str(op), tcp->pid, sig);