Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/lockstat move all the necessay code inside ifdef



details:   https://anonhg.NetBSD.org/src/rev/91391b9c38ec
branches:  trunk
changeset: 790701:91391b9c38ec
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 19 17:10:17 2013 +0000

description:
move all the necessay code inside ifdef

diffstat:

 usr.sbin/lockstat/elf32.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r ac837a3bf6c4 -r 91391b9c38ec usr.sbin/lockstat/elf32.c
--- a/usr.sbin/lockstat/elf32.c Sat Oct 19 17:09:38 2013 +0000
+++ b/usr.sbin/lockstat/elf32.c Sat Oct 19 17:10:17 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elf32.c,v 1.9 2011/02/05 13:32:32 yamt Exp $   */
+/*     $NetBSD: elf32.c,v 1.10 2013/10/19 17:10:17 christos Exp $      */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: elf32.c,v 1.9 2011/02/05 13:32:32 yamt Exp $");
+__RCSID("$NetBSD: elf32.c,v 1.10 2013/10/19 17:10:17 christos Exp $");
 #endif
 
 #ifndef ELFSIZE
@@ -166,9 +166,8 @@
 int
 NAME(findsym)(findsym_t find, char *name, uintptr_t *start, uintptr_t *end)
 {
-       static int lastptr[FIND_MAX];
        uintptr_t sa, ea;
-       int i, rv, off;
+       int i, off;
        Elf_Byte st;
 
        switch (find) {
@@ -184,9 +183,9 @@
                return -1;
        }
 
-       rv = -1;
 
 #ifdef dump_core
+       static int lastptr[FIND_MAX];
        for (i = lastptr[find];;) {
 #else
        for (i = 0; i < nsyms; i++) {
@@ -239,6 +238,8 @@
        return -1;
 
  found:
+#ifdef dump_core
        lastptr[find] = i;
+#endif
        return 0;
 }



Home | Main Index | Thread Index | Old Index