projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3163 from rpv-tomsk/virt-1
[collectd.git]
/
src
/
powerdns.c
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
74e671b
..
a5b45a1
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-26,8
+26,8
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include "utils_llist.h"
#include <errno.h>
#include "utils_llist.h"
#include <errno.h>
@@
-44,15
+44,12
@@
#endif
#define FUNC_ERROR(func) \
do { \
#endif
#define FUNC_ERROR(func) \
do { \
- char errbuf[1024]; \
- ERROR("powerdns plugin: %s failed: %s", func, \
- sstrerror(errno, errbuf, sizeof(errbuf))); \
+ ERROR("powerdns plugin: %s failed: %s", func, STRERRNO); \
} while (0)
#define SOCK_ERROR(func, sockpath) \
do { \
} while (0)
#define SOCK_ERROR(func, sockpath) \
do { \
- char errbuf[1024]; \
ERROR("powerdns plugin: Socket `%s` %s failed: %s", sockpath, func, \
ERROR("powerdns plugin: Socket `%s` %s failed: %s", sockpath, func, \
-
sstrerror(errno, errbuf, sizeof(errbuf)));
\
+
STRERRNO);
\
} while (0)
#define SERVER_SOCKET LOCALSTATEDIR "/run/pdns.controlsocket"
} while (0)
#define SERVER_SOCKET LOCALSTATEDIR "/run/pdns.controlsocket"
@@
-307,10
+304,10
@@
static statname_lookup_t lookup_table[] = /* {{{ */
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
-static llist_t *list
= NULL
;
+static llist_t *list;
#define PDNS_LOCAL_SOCKPATH LOCALSTATEDIR "/run/" PACKAGE_NAME "-powerdns"
#define PDNS_LOCAL_SOCKPATH LOCALSTATEDIR "/run/" PACKAGE_NAME "-powerdns"
-static char *local_sockpath
= NULL
;
+static char *local_sockpath;
/* TODO: Do this before 4.4:
* - Update the collectd.conf(5) manpage.
/* TODO: Do this before 4.4:
* - Update the collectd.conf(5) manpage.
@@
-355,16
+352,13
@@
static void submit(const char *plugin_instance, /* {{{ */
}
if (ds->ds_num != 1) {
}
if (ds->ds_num != 1) {
- ERROR("powerdns plugin: type `%s' has %
zu
data sources, "
+ ERROR("powerdns plugin: type `%s' has %
" PRIsz "
data sources, "
"but I can only handle one.",
type, ds->ds_num);
return;
}
if (0 != parse_value(value_str, &value, ds->ds[0].type)) {
"but I can only handle one.",
type, ds->ds_num);
return;
}
if (0 != parse_value(value_str, &value, ds->ds[0].type)) {
- ERROR("powerdns plugin: Cannot convert `%s' "
- "to a number.",
- value_str);
return;
}
return;
}
@@
-475,7
+469,7
@@
static int powerdns_get_data_dgram(list_item_t *item, char **ret_buffer) {
}
memcpy(buffer, temp, buffer_size - 1);
}
memcpy(buffer, temp, buffer_size - 1);
- buffer[buffer_size - 1] =
0
;
+ buffer[buffer_size - 1] =
'\0'
;
*ret_buffer = buffer;
return 0;
*ret_buffer = buffer;
return 0;