aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2009-07-14 15:16:53 -0600
committerRoland Dreier <rolandd@cisco.com>2009-07-16 14:53:06 -0700
commit8af67ff9d4faa0d624f058148aee4e3fb0f12aab (patch)
tree03bafb59b7253570ddeb607ef0e204b61eb95f1b
parentb9fb2f621198ab9d481fa8df009efc42398078bb (diff)
downloadlibibverbs-8af67ff9d4faa0d624f058148aee4e3fb0f12aab.tar.gz
Allow config file paths to the driver library to be absolute
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>
-rw-r--r--src/init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/init.c b/src/init.c
index 82dfae4..90d4292 100644
--- a/src/init.c
+++ b/src/init.c
@@ -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",