1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Suppress locking library load failure message if --ignorelockingfailure.

This commit is contained in:
Alasdair Kergon 2006-04-03 18:43:55 +00:00
parent 99048d18b9
commit 1a01b0c103
5 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.03 -
===================================
Suppress locking library load failure message if --ignorelockingfailure.
Propagate partial mode around cluster.
Fix archive file expiration.
Fix dmeventd build.

View File

@ -657,7 +657,7 @@ static int _init_formats(struct cmd_context *cmd)
return 0;
}
if (!(lib = load_shared_library(cmd->cft, cv->v.str,
"format"))) {
"format", 0))) {
stack;
return 0;
}
@ -753,7 +753,7 @@ static int _init_segtypes(struct cmd_context *cmd)
return 0;
}
if (!(lib = load_shared_library(cmd->cft, cv->v.str,
"segment type"))) {
"segment type", 0))) {
stack;
return 0;
}

View File

@ -72,7 +72,7 @@ int init_external_locking(struct locking_type *locking, struct config_tree *cft)
libname = find_config_str(cft->root, "global/locking_library",
DEFAULT_LOCKING_LIB);
if (!(_locking_lib = load_shared_library(cft, libname, "locking"))) {
if (!(_locking_lib = load_shared_library(cft, libname, "locking", 1))) {
stack;
return 0;
}

View File

@ -38,7 +38,7 @@ void get_shared_library_path(struct config_tree *cft, const char *libname,
}
void *load_shared_library(struct config_tree *cft, const char *libname,
const char *desc)
const char *desc, int silent)
{
char path[PATH_MAX];
void *library;
@ -47,8 +47,14 @@ void *load_shared_library(struct config_tree *cft, const char *libname,
log_very_verbose("Opening shared %s library %s", desc, path);
if (!(library = dlopen(path, RTLD_LAZY)))
log_error("Unable to open external %s library %s", desc, path);
if (!(library = dlopen(path, RTLD_LAZY))) {
if (silent && ignorelockingfailure())
log_verbose("Unable to open external %s library %s",
desc, path);
else
log_error("Unable to open external %s library %s",
desc, path);
}
return library;
}

View File

@ -19,4 +19,4 @@
void get_shared_library_path(struct config_tree *cft, const char *libname,
char *path, int path_len);
void *load_shared_library(struct config_tree *cf, const char *libname,
const char *what);
const char *what, int silent);