From: Florian Forster Date: Tue, 13 May 2008 10:54:48 +0000 (+0200) Subject: Merge branch 'collectd-4.4' X-Git-Tag: collectd-4.5.0~156 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=47faf00c18402cefd0e195d63ad48d5e7e6a4a92;p=collectd.git Merge branch 'collectd-4.4' --- 47faf00c18402cefd0e195d63ad48d5e7e6a4a92 diff --cc src/powerdns.c index 672b505c,51e39ee2..9d93f93d --- a/src/powerdns.c +++ b/src/powerdns.c @@@ -852,16 -859,8 +859,9 @@@ static int powerdns_config_add_server ( break; } - if (item->command == NULL) - { - ERROR ("powerdns plugin: item->command == NULL."); - status = -1; - break; - } - item->sockaddr.sun_family = AF_UNIX; - sstrncpy (item->sockaddr.sun_path, socket_temp, UNIX_PATH_MAX); + sstrncpy (item->sockaddr.sun_path, socket_temp, + sizeof (item->sockaddr.sun_path)); e = llentry_create (item->instance, item); if (e == NULL) diff --cc src/utils_cmd_putval.c index 023e4a71,75523881..8fbc8de3 --- a/src/utils_cmd_putval.c +++ b/src/utils_cmd_putval.c @@@ -23,7 -23,16 +23,15 @@@ #include "common.h" #include "plugin.h" + #define print_to_socket(fh, ...) \ + if (fprintf (fh, __VA_ARGS__) < 0) { \ + char errbuf[1024]; \ + WARNING ("handle_putval: failed to write to socket #%i: %s", \ + fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \ + return -1; \ + } + static int parse_value (const data_set_t *ds, value_list_t *vl, - const char *type, FILE *fh, char *buffer) { char *dummy;