diff options
Diffstat (limited to 'libexec/ld.so/ldconfig')
-rw-r--r-- | libexec/ld.so/ldconfig/ld.h | 11 | ||||
-rw-r--r-- | libexec/ld.so/ldconfig/ldconfig.c | 19 | ||||
-rw-r--r-- | libexec/ld.so/ldconfig/shlib.c | 12 |
3 files changed, 24 insertions, 18 deletions
diff --git a/libexec/ld.so/ldconfig/ld.h b/libexec/ld.so/ldconfig/ld.h index 30abc5c7bba..1d60f0b6f64 100644 --- a/libexec/ld.so/ldconfig/ld.h +++ b/libexec/ld.so/ldconfig/ld.h @@ -1,6 +1,6 @@ -/* $OpenBSD: ld.h,v 1.5 2002/05/24 00:25:42 ericj Exp $ */ +/* $OpenBSD: ld.h,v 1.6 2002/05/24 03:44:37 deraadt Exp $ */ /* - * Header file to make code compatible with ELF version + * Header file to make code compatible with ELF version * ldconfig was taken from the a.out ld. */ #include <link.h> @@ -12,4 +12,11 @@ void *xmalloc(size_t); void *xrealloc(void *, size_t); char *concat(const char *, const char *, const char *); +void add_search_dir(char *name); +void std_search_path(void); +void add_search_path(char *path); +void remove_search_dir(char *name); +int getdewey(int dewey[], char *cp); +int cmpndewey(int d1[], int n1, int d2[], int n2); + #define PAGSIZ __LDPGSZ diff --git a/libexec/ld.so/ldconfig/ldconfig.c b/libexec/ld.so/ldconfig/ldconfig.c index 06cc9268f12..cd0c111e2d9 100644 --- a/libexec/ld.so/ldconfig/ldconfig.c +++ b/libexec/ld.so/ldconfig/ldconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldconfig.c,v 1.8 2002/05/22 06:35:44 deraadt Exp $ */ +/* $OpenBSD: ldconfig.c,v 1.9 2002/05/24 03:44:37 deraadt Exp $ */ /* * Copyright (c) 1993,1995 Paul Kranenburg @@ -114,8 +114,8 @@ char *argv[]; verbose = 1; break; default: - (void)fprintf(stderr, - "usage: %s [-RUmrsv] [dir ...]\n", __progname); + fprintf(stderr, + "usage: %s [-RUmrsv] [dir ...]\n", __progname); exit(1); break; } @@ -221,7 +221,6 @@ int silent; ndewey = getdewey(dewey, cp + 4); enter(dir, dp->d_name, name, dewey, ndewey); } - return 0; } @@ -242,8 +241,8 @@ int dewey[], ndewey; /* Update this entry with higher versioned lib */ if (verbose) printf("Updating lib%s.%d.%d to %s/%s\n", - shp->name, shp->major, shp->minor, - dir, file); + shp->name, shp->major, shp->minor, + dir, file); free(shp->name); shp->name = xstrdup(name); @@ -332,7 +331,7 @@ buildhints() if (verbose) printf("Totals: entries %d, buckets %ld, string size %d\n", - nhints, hdr.hh_nbucket, strtab_sz); + nhints, hdr.hh_nbucket, strtab_sz); /* Allocate buckets and string table */ blist = (struct hints_bucket *)xmalloc(n); @@ -347,8 +346,8 @@ buildhints() for (shp = shlib_head; shp; shp = shp->next) { struct hints_bucket *bp; - bp = blist + - (hinthash(shp->name, shp->major, shp->minor) % hdr.hh_nbucket); + bp = blist + (hinthash(shp->name, shp->major, shp->minor) % + hdr.hh_nbucket); if (bp->hi_pathx) { int i; @@ -525,7 +524,7 @@ listhints() for (i = 0, shp = shlib_head; shp; i++, shp = shp->next) printf("\t%d:-l%s.%d.%d => %s\n", - i, shp->name, shp->major, shp->minor, shp->path); + i, shp->name, shp->major, shp->minor, shp->path); return; } diff --git a/libexec/ld.so/ldconfig/shlib.c b/libexec/ld.so/ldconfig/shlib.c index 690e722b931..12d4ef57414 100644 --- a/libexec/ld.so/ldconfig/shlib.c +++ b/libexec/ld.so/ldconfig/shlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shlib.c,v 1.4 2002/05/22 06:35:44 deraadt Exp $ */ +/* $OpenBSD: shlib.c,v 1.5 2002/05/24 03:44:37 deraadt Exp $ */ /* $NetBSD: shlib.c,v 1.13 1998/04/04 01:00:29 fvdl Exp $ */ /* @@ -154,7 +154,7 @@ char *path; } void -std_search_path() +std_search_path(void) { int i, n; @@ -172,8 +172,8 @@ std_search_path() int getdewey(dewey, cp) -int dewey[]; -char *cp; + int dewey[]; + char *cp; { int i, n; @@ -266,7 +266,7 @@ int do_dot_a; for (i = 0; i < n_search_dirs; i++) { DIR *dd = opendir(search_dirs[i]); struct dirent *dp; - char *path = NULL; + char *path = NULL; if (dd == NULL) continue; @@ -297,7 +297,7 @@ int do_dot_a; continue; if (n != 1 && minor != -1 && tmp[1] < minor) continue; - } + } if (cmpndewey(tmp, n, dewey, ndewey) <= 0) continue; |