[PATCH 67] introduce get_stop_code(context) helper

Oleg Nesterov oleg at redhat.com
Tue Oct 6 00:11:42 UTC 2009


Trivial, to simplify the review of the next patches.

->ev_name is used as rvalue in ptrace_resume(), add the trivial helper
to read this member.

---

 kernel/ptrace.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- PU/kernel/ptrace.c~67_GET_STOP_CODE_HELPER	2009-10-06 01:11:40.000000000 +0200
+++ PU/kernel/ptrace.c	2009-10-06 01:23:21.000000000 +0200
@@ -47,6 +47,11 @@ static inline bool ev_pending(struct ptr
 	return context->ev_name != 0;
 }
 
+static inline int get_stop_code(struct ptrace_context *context)
+{
+	return context->ev_name;
+}
+
 static inline struct ptrace_context *
 ptrace_context(struct utrace_engine *engine)
 {
@@ -916,7 +921,7 @@ static void do_ptrace_resume(struct utra
 {
 	struct ptrace_context *context = ptrace_context(engine);
 
-	switch (context->ev_name) {
+	switch (get_stop_code(context)) {
 	case 0:
 		// XXX: JCTL stop
 		break;
@@ -931,7 +936,7 @@ static void do_ptrace_resume(struct utra
 	}
 
 	if (request == PTRACE_SYSCALL) {
-		switch (context->ev_name) {
+		switch (get_stop_code(context)) {
 		case PTRACE_EVENT_EXEC:
 		case PTRACE_EVENT_FORK:
 		case PTRACE_EVENT_CLONE:
@@ -945,7 +950,7 @@ static void do_ptrace_resume(struct utra
 	}
 
 	if (action != UTRACE_RESUME) {
-		switch (context->ev_name) {
+		switch (get_stop_code(context)) {
 		case PTRACE_EVENT_EXEC:
 		case PTRACE_EVENT_FORK:
 		case PTRACE_EVENT_CLONE:




More information about the utrace-devel mailing list