Version 2.02.105 -
=====================================
+ Cache global library dir in command context.
Return success when inserting dirs and links into device cache.
Test for remote exclusive activation after activation fails.
Support lvconvert --merge for thin snapshots.
#include "lib.h"
#include "config.h"
#include "sharedlib.h"
+#include "toolcontext.h"
#include <limits.h>
#include <sys/stat.h>
char *path, size_t path_len)
{
struct stat info;
- const char *lib_dir;
/* If libname doesn't begin with '/' then use lib_dir/libname,
* if present */
if (libname[0] == '/' ||
- !(lib_dir = find_config_tree_str(cmd, global_library_dir_CFG, NULL)) ||
- (dm_snprintf(path, path_len, "%s/%s", lib_dir,
+ (!cmd->lib_dir &&
+ !(cmd->lib_dir = find_config_tree_str(cmd, global_library_dir_CFG, NULL))) ||
+ (dm_snprintf(path, path_len, "%s/%s", cmd->lib_dir,
libname) == -1) || stat(path, &info) == -1) {
strncpy(path, libname, path_len - 1);
path[path_len - 1] = '\0';