From 7f56eb7b93f7774321c3f5924447d96ffcb858b9 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 23 Dec 1994 22:31:35 +0000 Subject: Updated to recent version of Paul K.'s shlib code. This code has better warning handling and allows for link-time warnings with a modified version of gas. Note: Not all of the newer bits were updated such as some of the non-x86 machine-dependant code is relevant to FreeBSD right now. Obtained from: NetBSD --- sbin/ldconfig/ldconfig.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'sbin/ldconfig/ldconfig.c') diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c index b31271f..74f7f15 100644 --- a/sbin/ldconfig/ldconfig.c +++ b/sbin/ldconfig/ldconfig.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: ldconfig.c,v 1.6 1994/06/05 19:04:11 ats Exp $ + * $Id: ldconfig.c,v 1.7 1994/06/15 22:40:56 rich Exp $ */ #include @@ -54,7 +54,8 @@ #undef major #undef minor -char *progname; +extern char *__progname; + static int verbose; static int nostd; static int justread; @@ -84,12 +85,6 @@ char *argv[]; { int i, c; int rval = 0; - extern int optind; - - if ((progname = strrchr(argv[0], '/')) == NULL) - progname = argv[0]; - else - progname++; while ((c = getopt(argc, argv, "rsv")) != EOF) { switch (c) { @@ -103,7 +98,8 @@ char *argv[]; justread = 1; break; default: - fprintf(stderr, "Usage: %s [-r] [-s] [-v] [dir ...]\n", progname); + fprintf(stderr, "Usage: %s [-r][-s][-v][dir ...]\n", + __progname); exit(1); break; } @@ -368,7 +364,7 @@ listhints() } msize = PAGSIZ; - addr = mmap(0, msize, PROT_READ, MAP_FILE|MAP_COPY, fd, 0); + addr = mmap(0, msize, PROT_READ, MAP_COPY, fd, 0); if (addr == (caddr_t)-1) { perror(_PATH_LD_HINTS); @@ -389,7 +385,7 @@ listhints() if (hdr->hh_ehints > msize) { if (mmap(addr+msize, hdr->hh_ehints - msize, - PROT_READ, MAP_FILE|MAP_COPY|MAP_FIXED, + PROT_READ, MAP_COPY|MAP_FIXED, fd, msize) != (caddr_t)(addr+msize)) { perror(_PATH_LD_HINTS); -- cgit v1.1