Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Use the same idiom for iterating ov...



details:   https://anonhg.NetBSD.org/src/rev/c87bc7e59554
branches:  trunk
changeset: 495680:c87bc7e59554
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Wed Aug 02 22:47:44 2000 +0000

description:
Use the same idiom for iterating over allproc as everywhere else in the kernel.

diffstat:

 sys/arch/sparc64/sparc64/db_interface.c |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (45 lines):

diff -r 446bacf27f5d -r c87bc7e59554 sys/arch/sparc64/sparc64/db_interface.c
--- a/sys/arch/sparc64/sparc64/db_interface.c   Wed Aug 02 22:26:35 2000 +0000
+++ b/sys/arch/sparc64/sparc64/db_interface.c   Wed Aug 02 22:47:44 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.38 2000/07/27 13:57:23 mrg Exp $ */
+/*     $NetBSD: db_interface.c,v 1.39 2000/08/02 22:47:44 nathanw Exp $ */
 
 /*
  * Mach Operating System
@@ -593,8 +593,7 @@
        struct proc *p;
 
        /* XXX LOCKING XXX */
-       p = allproc.lh_first;
-       while (p != 0) {
+       for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) {
                if (p->p_stat) {
                        db_printf("process %p:", p);
                        db_printf("pid:%d pmap:%p ctx:%x tf:%p lastcall:%s\n",
@@ -603,7 +602,6 @@
                                  p->p_md.md_tf, 
                                  (p->p_addr->u_pcb.lastcall)?p->p_addr->u_pcb.lastcall:"Null");
                }
-               p = p->p_list.le_next;
        }
        return;
 }
@@ -671,8 +669,7 @@
                return;
        }
     
-       p = allproc.lh_first;
-       while (p != 0) {
+       for (p = allproc.lh_first; p != 0; p->p_list.le_next) {
                pp = p->p_pptr;
                if (p->p_stat && p->p_pid == addr) {
                        curproc = p;
@@ -684,7 +681,6 @@
                        db_printf("PID %d has a null context.\n", addr);
                        return;
                }
-               p = p->p_list.le_next;
        }
        db_printf("PID %d not found.\n", addr);
 }



Home | Main Index | Thread Index | Old Index