[monitoring-plugins] Try fixing deprecated functions in libdbi
RincewindsHat
git at monitoring-plugins.org
Wed Jul 12 10:00:12 CEST 2023
Module: monitoring-plugins
Branch: master
Commit: b4e578e2cd835221ee343e56923588828d36f99b
Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
Date: Sun Mar 12 21:37:00 2023 +0100
URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=b4e578e
Try fixing deprecated functions in libdbi
---
plugins/check_dbi.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c
index ced13d0..bbeb3d6 100644
--- a/plugins/check_dbi.c
+++ b/plugins/check_dbi.c
@@ -141,21 +141,28 @@ main (int argc, char **argv)
if (verbose > 2)
printf ("Initializing DBI\n");
- if (dbi_initialize (NULL) < 0) {
+ dbi_inst *instance_p;
+
+ if (dbi_initialize_r(NULL, instance_p) < 0) {
printf ("UNKNOWN - failed to initialize DBI; possibly you don't have any drivers installed.\n");
return STATE_UNKNOWN;
}
+ if (instance_p == NULL) {
+ printf ("UNKNOWN - failed to initialize DBI.\n");
+ return STATE_UNKNOWN;
+ }
+
if (verbose)
printf ("Opening DBI driver '%s'\n", np_dbi_driver);
- driver = dbi_driver_open (np_dbi_driver);
+ driver = dbi_driver_open_r(np_dbi_driver, instance_p);
if (! driver) {
printf ("UNKNOWN - failed to open DBI driver '%s'; possibly it's not installed.\n",
np_dbi_driver);
printf ("Known drivers:\n");
- for (driver = dbi_driver_list (NULL); driver; driver = dbi_driver_list (driver)) {
+ for (driver = dbi_driver_list_r(NULL, instance_p); driver; driver = dbi_driver_list_r(driver, instance_p)) {
printf (" - %s\n", dbi_driver_get_name (driver));
}
return STATE_UNKNOWN;
More information about the Commits
mailing list