From e5bbb2e4b5520a16947e4535a4c29cd4a3139882 Mon Sep 17 00:00:00 2001 From: John Polstra Date: Thu, 10 Oct 1996 23:16:50 +0000 Subject: Add the search directories from the hints file only the first time it is opened. After that, the directories are already present, and there is no point in adding them again. This doesn't fix any bugs; it's just for efficiency. --- libexec/rtld-aout/rtld.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libexec') diff --git a/libexec/rtld-aout/rtld.c b/libexec/rtld-aout/rtld.c index fc1024b1f5f0..f470c5ebc105 100644 --- a/libexec/rtld-aout/rtld.c +++ b/libexec/rtld-aout/rtld.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: rtld.c,v 1.37 1996/10/01 16:09:18 nate Exp $ + * $Id: rtld.c,v 1.38 1996/10/10 04:10:32 jdp Exp $ */ #include @@ -1575,6 +1575,7 @@ static char *hstrtab; maphints __P((void)) { static int hints_bad; /* TRUE if hints are unusable */ + static int paths_added; int hfd; struct hints_header hdr; caddr_t addr; @@ -1616,8 +1617,10 @@ maphints __P((void)) hbuckets = (struct hints_bucket *)(addr + hheader->hh_hashtab); hstrtab = (char *)(addr + hheader->hh_strtab); /* pluck out the system ldconfig path */ - if (hheader->hh_version >= LD_HINTS_VERSION_2) + if (hheader->hh_version >= LD_HINTS_VERSION_2 && !paths_added) { add_search_path(hstrtab + hheader->hh_dirlist); + paths_added = 1; + } return 0; } -- cgit v1.3