Module Name:    src
Committed By:   jmcneill
Date:           Mon Sep  5 18:16:34 UTC 2011

Modified Files:
        src/sys/arch/usermode/usermode: urkelvisor.c

Log Message:
check WIFSTOPPED status


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/usermode/usermode/urkelvisor.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/usermode/usermode/urkelvisor.c
diff -u src/sys/arch/usermode/usermode/urkelvisor.c:1.5 src/sys/arch/usermode/usermode/urkelvisor.c:1.6
--- src/sys/arch/usermode/usermode/urkelvisor.c:1.5	Mon Sep  5 13:28:17 2011
+++ src/sys/arch/usermode/usermode/urkelvisor.c	Mon Sep  5 18:16:34 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: urkelvisor.c,v 1.5 2011/09/05 13:28:17 jmcneill Exp $ */
+/* $NetBSD: urkelvisor.c,v 1.6 2011/09/05 18:16:34 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcne...@invisible.ca>
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __NetBSD__
-__RCSID("$NetBSD: urkelvisor.c,v 1.5 2011/09/05 13:28:17 jmcneill Exp $");
+__RCSID("$NetBSD: urkelvisor.c,v 1.6 2011/09/05 18:16:34 jmcneill Exp $");
 #endif
 
 #include <sys/types.h>
@@ -153,16 +153,18 @@
 
 		//fprintf(stderr, "syscall insyscall=%d status=%x\n",
 		//    insyscall, status);
-		if (WSTOPSIG(status) == SIGTRAP) {
-			insyscall = !insyscall;
-			if (insyscall) {
-				ptrace_getregs(urkel_pid, &uregs);
-				sig = handle_syscall(&uregs, urkel_pid);
-				if (sig)
-					insyscall = !insyscall;
+		if (WIFSTOPPED(status)) {
+			if (WSTOPSIG(status) == SIGTRAP) {
+				insyscall = !insyscall;
+				if (insyscall) {
+					ptrace_getregs(urkel_pid, &uregs);
+					sig = handle_syscall(&uregs, urkel_pid);
+					if (sig)
+						insyscall = !insyscall;
+				}
+			} else {
+				sig = WSTOPSIG(status);
 			}
-		} else {
-			sig = WSTOPSIG(status);
 		}
 	}
 }

Reply via email to