This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Fix error checking in utrace_attach_task()
- From: Atsushi Tsuji <a-tsuji at bk dot jp dot nec dot com>
- To: systemtap ML <systemtap at sources dot redhat dot com>
- Date: Thu, 02 Jun 2011 09:38:08 +0900
- Subject: [PATCH] Fix error checking in utrace_attach_task()
utrace_attach_task() returns not ENOENT but ESRCH in case of
UTRACE_ATTACH_CREATE if an error occurs. So this patch fixes
error checking to correctly ignore processes in "mortally
wounded" state.
Signed-off-by: Atsushi Tsuji <a-tsuji@bk.jp.nec.com>
---
runtime/task_finder.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index 2c52175..552972b 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -506,7 +506,7 @@ __stp_utrace_attach(struct task_struct *tsk,
engine = utrace_attach_task(tsk, UTRACE_ATTACH_CREATE, ops, data);
if (IS_ERR(engine)) {
int error = -PTR_ERR(engine);
- if (error != ENOENT) {
+ if (error != ESRCH) {
_stp_error("utrace_attach returned error %d on pid %d",
error, (int)tsk->pid);
rc = error;
-- 1.7.2.1