Page 1 of 1

[Nagios-devel] [PATCH] nebmods: log failure to dlclose() neb modules

Posted: Thu Sep 26, 2013 2:00 am
by Guest
We recently had a problem with a buggy glibc implementation of dlclose
causing module unloading to misbehave. Chances are having been
informed of the result of the dlclose() call would've been helpful in
debugging that.

Signed-off-by: Anton Lofgren
---
base/nebmods.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/base/nebmods.c b/base/nebmods.c
index f6489f8..d98e412 100644
--- a/base/nebmods.c
+++ b/base/nebmods.c
@@ -303,6 +303,11 @@ int neb_unload_module(nebmodule *mod, int flags,
int reason) {

/* unload the module */
result = dlclose(mod->module_handle);
+
+ if (result != 0) {
+ logit(NSLOG_RUNTIME_ERROR, TRUE, "Error: Could not unload module
'%s' -> %s\n", mod->filename, dlerror());
+ return ERROR;
+ }
}

/* mark the module as being unloaded */
--
1.8.4

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/ ... stg.clktrk
_______________________________________________
Nagios-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/lis ... gios-devel



This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]

Re: [Nagios-devel] [PATCH] nebmods: log failure to dlclose()

Posted: Fri Oct 04, 2013 5:28 pm
by estanley
Thanks, Anton. The patch has been applied and is now in the Sourceforge git. It will be in the next release.