X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdns.c;h=fe3b672a21d844b2190c80e7b2f7bffd9adb9b50;hb=3faf514fd9b869cadda0f895e14e5036313c7781;hp=f6c3504731cfe55bef6c810d3abe1d41a2e33624;hpb=565c731a4353d1453b65dc9a4267e1f8e4740c06;p=collectd.git diff --git a/src/dns.c b/src/dns.c index f6c35047..fe3b672a 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1,6 +1,6 @@ /** * collectd - src/dns.c - * Copyright (C) 2006,2007 Florian octo Forster + * Copyright (C) 2006-2011 Florian octo Forster * Copyright (C) 2009 Mirko Buffoni * * This program is free software; you can redistribute it and/or modify it @@ -17,7 +17,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Authors: - * Florian octo Forster + * Florian octo Forster * Mirko Buffoni **/ @@ -30,9 +30,11 @@ #include "utils_dns.h" #include -#include #include +#include +#include + /* * Private data types */ @@ -206,7 +208,7 @@ static void dns_child_callback (const rfc1035_header_t *dns) pthread_mutex_unlock (&opcode_mutex); } -static void *dns_child_loop (void __attribute__((unused)) *dummy) +static void *dns_child_loop (__attribute__((unused)) void *dummy) { pcap_t *pcap_obj; char pcap_error[PCAP_ERRBUF_SIZE]; @@ -226,7 +228,7 @@ static void *dns_child_loop (void __attribute__((unused)) *dummy) pcap_obj = pcap_open_live ((pcap_device != NULL) ? pcap_device : "any", PCAP_SNAPLEN, 0 /* Not promiscuous */, - (int) CDTIME_T_TO_MS (interval_g / 2), + (int) CDTIME_T_TO_MS (plugin_get_interval () / 2), pcap_error); if (pcap_obj == NULL) { @@ -284,7 +286,7 @@ static int dns_init (void) if (listen_thread_init != 0) return (-1); - status = pthread_create (&listen_thread, NULL, dns_child_loop, + status = plugin_thread_create (&listen_thread, NULL, dns_child_loop, (void *) 0); if (status != 0) {