[collectd] [PATCH] Replaced plugin_flush_all(t) with plugin_flush(NULL, t, NULL).

Sebastian Harl sh at tokkee.org
Thu Aug 21 11:15:02 CEST 2008


There is nothing that plugin_flush_all() would do but plugin_flush() wouldn't,
so this was redundant.

plugin_flush_all() has been removed completely.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 src/collectd.c        |    2 +-
 src/plugin.c          |   18 ------------------
 src/plugin.h          |    1 -
 src/utils_cmd_flush.c |    2 +-
 4 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/src/collectd.c b/src/collectd.c
index 5484322..71eb940 100644
--- a/src/collectd.c
+++ b/src/collectd.c
@@ -50,7 +50,7 @@ static int loop = 0;
 static void *do_flush (void *arg)
 {
 	INFO ("Flushing all data.");
-	plugin_flush_all (-1);
+	plugin_flush (NULL, -1, NULL);
 	INFO ("Finished flushing all data.");
 	pthread_exit (NULL);
 	return NULL;
diff --git a/src/plugin.c b/src/plugin.c
index c47e867..b3feb17 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -665,24 +665,6 @@ void plugin_read_all (void)
 	pthread_mutex_unlock (&read_lock);
 } /* void plugin_read_all */
 
-void plugin_flush_all (int timeout)
-{
-	int (*callback) (int timeout, const char *identifier);
-	llentry_t *le;
-
-	if (list_flush == NULL)
-		return;
-
-	le = llist_head (list_flush);
-	while (le != NULL)
-	{
-		callback = (int (*) (int, const char *)) le->value;
-		le = le->next;
-
-		(*callback) (timeout, NULL);
-	}
-} /* void plugin_flush_all */
-
 int plugin_flush (const char *plugin, int timeout, const char *identifier)
 {
   int (*callback) (int timeout, const char *identifier);
diff --git a/src/plugin.h b/src/plugin.h
index f66ed3e..3ffde46 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -178,7 +178,6 @@ void plugin_init_all (void);
 void plugin_read_all (void);
 void plugin_shutdown_all (void);
 
-void plugin_flush_all (int timeout);
 int plugin_flush (const char *plugin, int timeout, const char *identifier);
 
 /*
diff --git a/src/utils_cmd_flush.c b/src/utils_cmd_flush.c
index 74807b8..0e7b350 100644
--- a/src/utils_cmd_flush.c
+++ b/src/utils_cmd_flush.c
@@ -164,7 +164,7 @@ int handle_flush (FILE *fh, char *buffer)
 	}
 	else
 	{
-		plugin_flush_all (timeout);
+		plugin_flush (NULL, timeout, NULL);
 		print_to_socket (fh, "0 Done\n");
 	}
 
-- 
1.6.0.rc2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080821/a6b14e55/attachment-0001.pgp 


More information about the collectd mailing list