[PATCH] Fix error checking in utrace_attach_task()

Atsushi Tsuji a-tsuji@bk.jp.nec.com
Thu Jun 2 00:43:00 GMT 2011


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 



More information about the Systemtap mailing list