Merge branch 'pr/1918'
[collectd.git] / src / ping.c
index 7b28ed3..39e9de5 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "common.h"
 #include "plugin.h"
-#include "configfile.h"
 #include "utils_complain.h"
 
 #include <netinet/in.h>
@@ -458,7 +457,7 @@ static int ping_init (void) /* {{{ */
     if (getuid () == 0)
       WARNING ("ping plugin: Running collectd as root, but the CAP_NET_RAW "
           "capability is missing. The plugin's read function will probably "
-          "fail. Is your init system dropping capabilities ?");
+          "fail. Is your init system dropping capabilities?");
     else
       WARNING ("ping plugin: collectd doesn't have the CAP_NET_RAW capability. "
           "If you don't want to run collectd as root, try running \"setcap "
@@ -616,12 +615,9 @@ static int ping_config (const char *key, const char *value) /* {{{ */
 static void submit (const char *host, const char *type, /* {{{ */
     gauge_t value)
 {
-  value_t values[1];
   value_list_t vl = VALUE_LIST_INIT;
 
-  values[0].gauge = value;
-
-  vl.values = values;
+  vl.values = &(value_t) { .gauge = value };
   vl.values_len = 1;
   sstrncpy (vl.host, hostname_g, sizeof (vl.host));
   sstrncpy (vl.plugin, "ping", sizeof (vl.plugin));