Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so print the program name when we don't find ...



details:   https://anonhg.NetBSD.org/src/rev/6795fc6d183b
branches:  trunk
changeset: 447473:6795fc6d183b
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 12 18:58:10 2019 +0000

description:
print the program name when we don't find a library.
XXX: really most _rtld_error() should do that, and most do.

diffstat:

 libexec/ld.elf_so/search.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 2ee7430291f9 -r 6795fc6d183b libexec/ld.elf_so/search.c
--- a/libexec/ld.elf_so/search.c        Sat Jan 12 17:38:36 2019 +0000
+++ b/libexec/ld.elf_so/search.c        Sat Jan 12 18:58:10 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: search.c,v 1.24 2013/05/06 08:02:20 skrll Exp $         */
+/*     $NetBSD: search.c,v 1.25 2019/01/12 18:58:10 christos Exp $      */
 
 /*
  * Copyright 1996 Matt Thomas <matt%3am-software.com@localhost>
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: search.c,v 1.24 2013/05/06 08:02:20 skrll Exp $");
+__RCSID("$NetBSD: search.c,v 1.25 2019/01/12 18:58:10 christos Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -117,6 +117,7 @@
 Obj_Entry *
 _rtld_load_library(const char *name, const Obj_Entry *refobj, int flags)
 {
+       extern char *__progname;
        char tmperror[512], *tmperrorp;
        Search_Path *sp;
        const char *pathname;
@@ -159,7 +160,8 @@
                    sp->sp_path, sp->sp_pathlen, flags)) != NULL)
                        goto pathfound;
 
-       _rtld_error("Shared object \"%s\" not found", name);
+       _rtld_error("%s: Shared object \"%s\" not found",
+           refobj ? refobj->path : __progname, name);
        return NULL;
 
 pathfound:



Home | Main Index | Thread Index | Old Index