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