Merge pull request #2051 from dsilakov/virt_list_domains
[collectd.git] / src / utils_cmd_flush.c
index 48243e6..25a5512 100644 (file)
@@ -31,7 +31,6 @@
 #include "common.h"
 #include "plugin.h"
 #include "utils_cmd_flush.h"
-#include "utils_parse_option.h"
 
 cmd_status_t cmd_parse_flush(size_t argc, char **argv, cmd_flush_t *ret_flush,
                              const cmd_options_t *opts,
@@ -137,23 +136,21 @@ cmd_status_t cmd_handle_flush(FILE *fh, char *buffer) {
 
     for (size_t j = 0; (j == 0) || (j < cmd.cmd.flush.identifiers_num); j++) {
       char *identifier = NULL;
-      char buffer[1024];
-      int status;
+      char buf[1024];
 
       if (cmd.cmd.flush.identifiers_num != 0) {
         identifier_t *id = cmd.cmd.flush.identifiers + j;
-        if (format_name(buffer, sizeof(buffer), id->host, id->plugin,
+        if (format_name(buf, sizeof(buf), id->host, id->plugin,
                         id->plugin_instance, id->type,
                         id->type_instance) != 0) {
           error++;
           continue;
         }
-        identifier = buffer;
+        identifier = buf;
       }
 
-      status = plugin_flush(plugin, DOUBLE_TO_CDTIME_T(cmd.cmd.flush.timeout),
-                            identifier);
-      if (status == 0)
+      if (plugin_flush(plugin, DOUBLE_TO_CDTIME_T(cmd.cmd.flush.timeout),
+                       identifier) == 0)
         success++;
       else
         error++;
@@ -178,5 +175,3 @@ void cmd_destroy_flush(cmd_flush_t *flush) {
   sfree(flush->identifiers);
   flush->identifiers_num = 0;
 } /* void cmd_destroy_flush */
-
-/* vim: set sw=4 ts=4 tw=78 noexpandtab : */