Fix compile time issues
[collectd.git] / src / dns.c
index e64af0d..dad0be2 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
 
 #include "collectd.h"
 
-#include "common.h"
 #include "plugin.h"
+#include "utils/common/common.h"
 
+#include "utils/dns/dns.h"
 #include <poll.h>
-#include "utils_dns.h"
 
 #include <pcap.h>
 
@@ -57,7 +57,7 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 static int select_numeric_qtype = 1;
 
 #define PCAP_SNAPLEN 1460
-static char *pcap_device = NULL;
+static char *pcap_device;
 
 static derive_t tr_queries;
 static derive_t tr_responses;
@@ -66,7 +66,7 @@ static counter_list_t *opcode_list;
 static counter_list_t *rcode_list;
 
 static pthread_t listen_thread;
-static int listen_thread_init = 0;
+static int listen_thread_init;
 /* The `traffic' mutex if for `tr_queries' and `tr_responses' */
 static pthread_mutex_t traffic_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t qtype_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -287,9 +287,7 @@ static int dns_init(void) {
   status = plugin_thread_create(&listen_thread, NULL, dns_child_loop, (void *)0,
                                 "dns listen");
   if (status != 0) {
-    char errbuf[1024];
-    ERROR("dns plugin: pthread_create failed: %s",
-          sstrerror(errno, errbuf, sizeof(errbuf)));
+    ERROR("dns plugin: pthread_create failed: %s", STRERRNO);
     return -1;
   }
 
@@ -326,7 +324,8 @@ static void submit_derive(const char *type, const char *type_instance,
 
 static void submit_octets(derive_t queries, derive_t responses) {
   value_t values[] = {
-      {.derive = queries}, {.derive = responses},
+      {.derive = queries},
+      {.derive = responses},
   };
   value_list_t vl = VALUE_LIST_INIT;