summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-27 09:40:55 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-09-27 09:40:55 +0000
commit54a760b1c0835ded3e8fbefde6391824bc5c531e (patch)
tree6fff2571c91f47afeeeb367c8d33742f884c1805 /utils
parente6c7d1de2a601b0c630df62e02c27a05962669d8 (diff)
Remove /usr/X11R6/lib from default list.
Move /lib and /usr/lib first in ld.so.cache. Ignore duplicate /lib and /usr/lib in ld.so.conf
Diffstat (limited to 'utils')
-rw-r--r--utils/ldconfig.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/utils/ldconfig.c b/utils/ldconfig.c
index d47c9e0bc..acb78a2ff 100644
--- a/utils/ldconfig.c
+++ b/utils/ldconfig.c
@@ -874,18 +874,28 @@ int main(int argc, char **argv)
/* look ma, no defaults */
if (!nodefault)
{
+ scan_dir(UCLIBC_RUNTIME_PREFIX "lib");
+ scan_dir(UCLIBC_RUNTIME_PREFIX "usr/lib");
+
/* I guess the defaults aren't good enough */
if ((extpath = get_extpath()))
{
- for (cp = strtok(extpath, DIR_SEP); cp;
- cp = strtok(NULL, DIR_SEP))
+ for (cp = strtok(extpath, DIR_SEP); cp; cp = strtok(NULL, DIR_SEP)) {
+ /* strip traling slashes */
+ int len = strlen(cp);
+ if (len)
+ while (cp[--len] == '/' && len)
+ cp[len] = 0;
+ if (strcmp(UCLIBC_RUNTIME_PREFIX "lib", cp) == 0 ||
+ strcmp(UCLIBC_RUNTIME_PREFIX "usr/lib", cp) == 0) {
+ if (verbose >= 0)
+ warnx("Path `%s' given more than once\n", cp);
+ continue;
+ }
scan_dir(cp);
+ }
free(extpath);
}
-
- scan_dir(UCLIBC_RUNTIME_PREFIX "/usr/X11R6/lib");
- scan_dir(UCLIBC_RUNTIME_PREFIX "/usr/lib");
- scan_dir(UCLIBC_RUNTIME_PREFIX "/lib");
}
#ifdef USE_CACHE