Module Name: src
Committed By: christos
Date: Sat Oct 19 17:10:17 UTC 2013
Modified Files:
src/usr.sbin/lockstat: elf32.c
Log Message:
move all the necessay code inside ifdef
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/lockstat/elf32.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/lockstat/elf32.c
diff -u src/usr.sbin/lockstat/elf32.c:1.9 src/usr.sbin/lockstat/elf32.c:1.10
--- src/usr.sbin/lockstat/elf32.c:1.9 Sat Feb 5 08:32:32 2011
+++ src/usr.sbin/lockstat/elf32.c Sat Oct 19 13:10:17 2013
@@ -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 @@ NAME(loadsym)(int fd)
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 @@ NAME(findsym)(findsym_t find, char *name
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 @@ NAME(findsym)(findsym_t find, char *name
return -1;
found:
+#ifdef dump_core
lastptr[find] = i;
+#endif
return 0;
}