From 1a01b0c103c8bf5a77b9ebadc964f8f22a66c285 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 3 Apr 2006 18:43:55 +0000 Subject: [PATCH] Suppress locking library load failure message if --ignorelockingfailure. --- WHATS_NEW | 1 + lib/commands/toolcontext.c | 4 ++-- lib/locking/external_locking.c | 2 +- lib/misc/sharedlib.c | 12 +++++++++--- lib/misc/sharedlib.h | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 6436989bb..30975696d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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. diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 7e1276635..1932b412c 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -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; } diff --git a/lib/locking/external_locking.c b/lib/locking/external_locking.c index c6d974115..a93923f8c 100644 --- a/lib/locking/external_locking.c +++ b/lib/locking/external_locking.c @@ -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; } diff --git a/lib/misc/sharedlib.c b/lib/misc/sharedlib.c index d068c7be0..81bde247a 100644 --- a/lib/misc/sharedlib.c +++ b/lib/misc/sharedlib.c @@ -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; } diff --git a/lib/misc/sharedlib.h b/lib/misc/sharedlib.h index b7bc5ea07..385c988e7 100644 --- a/lib/misc/sharedlib.h +++ b/lib/misc/sharedlib.h @@ -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); -- 2.43.5