]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more docs and fix return value
authorAlan T. DeKok <aland@freeradius.org>
Sun, 20 Sep 2020 13:58:13 +0000 (09:58 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 21 Sep 2020 16:17:27 +0000 (11:17 -0500)
src/build/dlopen.c

index 6bb428c58d9d1e3257e4019c7c3ede969c11456c..ad85f0ea88bae61b740a2db25cc00304572583a3 100644 (file)
@@ -194,6 +194,13 @@ static void *check_path(char *filename, char const *name, size_t namelen,
  *             If a library exists, but does NOT contain
  *                     "symbol", it is skipped.
  *
+ *  The function returns the full pathname where the library was
+ *  found, if the full pathname is available.  If no path is
+ *  available, it returns the library name. "libfoo".
+ *
+ *  If the dlopen() call fails, or the symbol isn't found, then the
+ *  function returns an empty string "".
+ *
  *  Library handles are cached across calls to $(dlopen ...).  So they
  *  should be closed with $(dlclose ...)
  *
@@ -377,11 +384,10 @@ static char *make_dlopen(UNUSED char const *nm, unsigned int argc, char **argv)
 found:
        if (!lib->filename) {
 no_file:
-               p = gmk_alloc(strlen(lib->name));
+               p = gmk_alloc(1);
                if (!p) goto oom;
 
-               p[0] = '1';
-               p[1] = '\0';
+               p[0] = '\0';
                return p;
        }