diff options
Diffstat (limited to 'libglusterfs/src/xlator.c')
-rw-r--r-- | libglusterfs/src/xlator.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 3c1cde50fa0..b2529d3c4f7 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -117,6 +117,14 @@ out: } +static const char *xlator_lib_path (void) +{ + const char *libdir_env = getenv ("GLUSTER_LIBDIR"); + + return libdir_env ? libdir_env : XLATORDIR; +} + + int xlator_volopt_dynload (char *xlator_type, void **dl_handle, volume_opt_list_t *opt_list) @@ -130,9 +138,11 @@ xlator_volopt_dynload (char *xlator_type, void **dl_handle, /* socket.so doesn't fall under the default xlator directory, hence we * need this check */ if (!strstr(xlator_type, "rpc-transport")) - ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xlator_type); + ret = gf_asprintf (&name, "%s/%s.so", xlator_lib_path (), + xlator_type); else - ret = gf_asprintf (&name, "%s/%s.so", XLATORPARENTDIR, xlator_type); + ret = gf_asprintf (&name, "%s/../%s.so", xlator_lib_path (), + xlator_type); if (-1 == ret) { goto out; } @@ -183,7 +193,7 @@ xlator_dynload (xlator_t *xl) INIT_LIST_HEAD (&xl->volume_options); - ret = gf_asprintf (&name, "%s/%s.so", XLATORDIR, xl->type); + ret = gf_asprintf (&name, "%s/%s.so", xlator_lib_path (), xl->type); if (-1 == ret) { goto out; } |