From: Sebastian Harl Date: Thu, 15 Nov 2012 09:04:46 +0000 (+0100) Subject: postgresql plugin: Fixed unregistering of write callbacks. X-Git-Tag: collectd-5.2.0~13^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=714ecdcf146a04fd0af331aaa67bad1b19cbce3a;p=collectd.git 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. --- 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);