diff options
author | jdp <jdp@FreeBSD.org> | 1996-10-10 23:16:50 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1996-10-10 23:16:50 +0000 |
commit | a61297ba870d3da81393dc13bc42bf05bf311efe (patch) | |
tree | 07ddb243f6ede43973cd5b9059a7018f597dfb45 /gnu/usr.bin/ld | |
parent | e11a58ddc64b58f7e2a82f1d772c407fb18007d3 (diff) | |
download | FreeBSD-src-a61297ba870d3da81393dc13bc42bf05bf311efe.zip FreeBSD-src-a61297ba870d3da81393dc13bc42bf05bf311efe.tar.gz |
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.
Diffstat (limited to 'gnu/usr.bin/ld')
-rw-r--r-- | gnu/usr.bin/ld/rtld/rtld.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gnu/usr.bin/ld/rtld/rtld.c b/gnu/usr.bin/ld/rtld/rtld.c index fc1024b..f470c5e 100644 --- a/gnu/usr.bin/ld/rtld/rtld.c +++ b/gnu/usr.bin/ld/rtld/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 <sys/param.h> @@ -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; } |