From 714ecdcf146a04fd0af331aaa67bad1b19cbce3a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 15 Nov 2012 10:04:46 +0100 Subject: [PATCH] postgresql plugin: Fixed unregistering of write callbacks. Rather than unregistering some callback for each writer for each database, unregister the single callback for each database only. --- src/postgresql.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/postgresql.c b/src/postgresql.c index 4d243605..ef7a5ec1 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -942,11 +942,9 @@ static int c_psql_shutdown (void) for (i = 0; i < databases_num; ++i) { c_psql_database_t *db = databases + i; - size_t j = 0; - for (j = 0; j < db->writers_num; ++j) { + if (db->writers_num > 0) { char cb_name[DATA_MAX_NAME_LEN]; - ssnprintf (cb_name, sizeof (cb_name), "postgresql-%s", db->database); plugin_unregister_write (cb_name); -- 2.30.2