Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/usermode check WIFSTOPPED status



details:   https://anonhg.NetBSD.org/src/rev/972c3b170f88
branches:  trunk
changeset: 769279:972c3b170f88
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Sep 05 18:16:34 2011 +0000

description:
check WIFSTOPPED status

diffstat:

 sys/arch/usermode/usermode/urkelvisor.c |  24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diffs (46 lines):

diff -r 46f10eba1520 -r 972c3b170f88 sys/arch/usermode/usermode/urkelvisor.c
--- a/sys/arch/usermode/usermode/urkelvisor.c   Mon Sep 05 18:11:53 2011 +0000
+++ b/sys/arch/usermode/usermode/urkelvisor.c   Mon Sep 05 18:16:34 2011 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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);
                }
        }
 }



Home | Main Index | Thread Index | Old Index