From b4e578e2cd835221ee343e56923588828d36f99b Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 12 Mar 2023 21:37:00 +0100 Subject: Try fixing deprecated functions in libdbi 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; -- cgit v0.10-9-g596f