This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]