Blame SOURCES/0021-ptrace_restart-do-not-print-diagnostics-when-ptrace-.patch

904f19
From 179063d63c4e1f49dd863db7ec5d70a3fa2a3713 Mon Sep 17 00:00:00 2001
904f19
From: Eugene Syromyatnikov <evgsyr@gmail.com>
904f19
Date: Mon, 11 Feb 2019 00:57:38 +0100
904f19
Subject: [PATCH 21/27] ptrace_restart: do not print diagnostics when ptrace
904f19
 returns ESRCH
904f19
904f19
After some discussion, it was decided that the situation
904f19
when the tracee is gone does not worth reporting.
904f19
904f19
* strace.c (ptrace_restart): Return early if ptrace returned ESRCH.
904f19
904f19
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1662936
904f19
---
904f19
 strace.c | 4 +---
904f19
 1 file changed, 1 insertion(+), 3 deletions(-)
904f19
904f19
diff --git a/strace.c b/strace.c
904f19
index f2aa846..0745838 100644
904f19
--- a/strace.c
904f19
+++ b/strace.c
904f19
@@ -353,7 +353,7 @@ ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig)
904f19
 	errno = 0;
904f19
 	ptrace(op, tcp->pid, 0L, (unsigned long) sig);
904f19
 	err = errno;
904f19
-	if (!err)
904f19
+	if (!err || err == ESRCH)
904f19
 		return 0;
904f19
 
904f19
 	switch (op) {
904f19
@@ -384,8 +384,6 @@ ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig)
904f19
 			tcp->pid, msg, strerror(err));
904f19
 		line_ended();
904f19
 	}
904f19
-	if (err == ESRCH)
904f19
-		return 0;
904f19
 	errno = err;
904f19
 	perror_msg("ptrace(PTRACE_%s,pid:%d,sig:%u)", msg, tcp->pid, sig);
904f19
 	return -1;
904f19
-- 
904f19
2.1.4
904f19