X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fpowerdns.c;h=b5d4a32f3c7d4c1291db8edfb848d0d181a8dc86;hb=cc893903f8453dc96a797b319bdd4e294052de6f;hp=d7aa4e9dbe8ea8d94ca739baa2750b1d2026a707;hpb=7d2981b4b3245d5ead2f3156a6b6c440691691cf;p=collectd.git diff --git a/src/powerdns.c b/src/powerdns.c index d7aa4e9d..b5d4a32f 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -51,7 +51,7 @@ #define RECURSOR_SOCKET LOCALSTATEDIR"/run/pdns_recursor.controlsocket" #define RECURSOR_COMMAND "get noerror-answers nxdomain-answers " \ "servfail-answers sys-msec user-msec qa-latency cache-entries cache-hits " \ - "cache-misses questions\n" + "cache-misses questions \n" struct list_item_s; typedef struct list_item_s list_item_t; @@ -377,7 +377,6 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ struct sockaddr_un sa_unix = { 0 }; - struct timeval stv_timeout; cdtime_t cdt_timeout; sd = socket (PF_UNIX, item->socktype, 0); @@ -423,9 +422,9 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ if (cdt_timeout < TIME_T_TO_CDTIME_T (2)) cdt_timeout = TIME_T_TO_CDTIME_T (2); - CDTIME_T_TO_TIMEVAL (cdt_timeout, &stv_timeout); - - status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, &stv_timeout, sizeof (stv_timeout)); + status = setsockopt (sd, SOL_SOCKET, SO_RCVTIMEO, + &CDTIME_T_TO_TIMEVAL(cdt_timeout), + sizeof(struct timeval)); if (status != 0) { SOCK_ERROR ("setsockopt", sa_unix.sun_path);