]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Allow config file paths to the driver library to be absolute
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Tue, 14 Jul 2009 21:16:53 +0000 (15:16 -0600)
committerRoland Dreier <rolandd@cisco.com>
Thu, 16 Jul 2009 21:53:06 +0000 (14:53 -0700)
If the driver line starts with a / then no lib prefix is applied and
the full path is passed to dlopen().  This allows a completely
self-contained installation that relies on RPATH for the binaries and
this mechanism for the drivers.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/init.c

index 82dfae4db94360b51c88625fafa57321e035f204..90d42920ea76711b022a25395c2e60fbb71488a0 100644 (file)
@@ -184,6 +184,8 @@ static void load_driver(const char *name)
 #define IBV_QUOTE(x)   __IBV_QUOTE(x)
 
        if (asprintf(&so_name,
+                    name[0] == '/' ?
+                    "%s-" IBV_QUOTE(IBV_DEVICE_LIBRARY_EXTENSION) ".so" :
                     "lib%s-" IBV_QUOTE(IBV_DEVICE_LIBRARY_EXTENSION) ".so",
                     name) < 0) {
                fprintf(stderr, PFX "Warning: couldn't load driver '%s'.\n",