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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

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

Post 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]
estanley
Posts: 19
Joined: Thu Apr 08, 2010 9:28 am

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

Post by estanley »

Thanks, Anton. The patch has been applied and is now in the Sourceforge git. It will be in the next release.
Locked