Switch to re-entrant libdbi functions. Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx> --- output/dbi/ulogd_output_DBI.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/output/dbi/ulogd_output_DBI.c b/output/dbi/ulogd_output_DBI.c index 23cc9c8fb492..461aed4bddb6 100644 --- a/output/dbi/ulogd_output_DBI.c +++ b/output/dbi/ulogd_output_DBI.c @@ -29,6 +29,8 @@ #define DEBUGP(x, args...) #endif +static dbi_inst libdbi_instance; + struct dbi_instance { struct db_instance db_inst; @@ -195,14 +197,14 @@ static int open_db_dbi(struct ulogd_pluginstance *upi) ulogd_log(ULOGD_ERROR, "Opening connection for db type %s\n", dbtype); - driver = dbi_driver_open(dbtype); + driver = dbi_driver_open_r(dbtype, libdbi_instance); if (driver == NULL) { ulogd_log(ULOGD_ERROR, "unable to load driver for db type %s\n", dbtype); close_db_dbi(upi); return -1; } - pi->dbh = dbi_conn_new(dbtype); + pi->dbh = dbi_conn_new_r(dbtype, libdbi_instance); if (pi->dbh == NULL) { ulogd_log(ULOGD_ERROR, "unable to initialize db type %s\n", dbtype); @@ -320,7 +322,7 @@ void __attribute__ ((constructor)) init(void); void init(void) { - dbi_initialize(NULL); + dbi_initialize_r(NULL, &libdbi_instance); ulogd_register_plugin(&dbi_plugin); } -- 2.33.0