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

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