From a61297ba870d3da81393dc13bc42bf05bf311efe Mon Sep 17 00:00:00 2001 From: jdp 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 fc1024b..f470c5e 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.1