X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_cmds.c;h=261a8287736fe24d34c78b59a2357a26552786fc;hb=aaa294ed9419515d6f84d20e891bc7cb0a49d4da;hp=055c987c03c6741444570db0e74681fca98585b5;hpb=7c2336dde35a7b42853b6ca167d4164619e52333;p=collectd.git diff --git a/src/utils_cmds.c b/src/utils_cmds.c index 055c987c..261a8287 100644 --- a/src/utils_cmds.c +++ b/src/utils_cmds.c @@ -26,12 +26,12 @@ * Sebastian 'tokkee' Harl **/ -#include "utils_cmds.h" #include "daemon/common.h" #include "utils_cmd_flush.h" #include "utils_cmd_getval.h" #include "utils_cmd_listval.h" #include "utils_cmd_putval.h" +#include "utils_cmds.h" #include "utils_parse_option.h" #include @@ -207,7 +207,7 @@ cmd_status_t cmd_parsev(size_t argc, char **argv, cmd_t *ret_cmd, } else if (strcasecmp("LISTVAL", command) == 0) { ret_cmd->type = CMD_LISTVAL; status = - cmd_parse_listval(argc - 1, argv + 1, &ret_cmd->cmd.listval, opts, err); + cmd_parse_listval(argc - 1, argv + 1, opts, err); } else if (strcasecmp("PUTVAL", command) == 0) { ret_cmd->type = CMD_PUTVAL; status = @@ -252,7 +252,6 @@ void cmd_destroy(cmd_t *cmd) { cmd_destroy_getval(&cmd->cmd.getval); break; case CMD_LISTVAL: - cmd_destroy_listval(&cmd->cmd.listval); break; case CMD_PUTVAL: cmd_destroy_putval(&cmd->cmd.putval); @@ -301,9 +300,8 @@ void cmd_error_fh(void *ud, cmd_status_t status, const char *format, vsnprintf(buf, sizeof(buf), format, ap); buf[sizeof(buf) - 1] = '\0'; if (fprintf(fh, "%i %s\n", code, buf) < 0) { - char errbuf[1024]; WARNING("utils_cmds: failed to write to file-handle #%i: %s", fileno(fh), - sstrerror(errno, errbuf, sizeof(errbuf))); + STRERRNO); return; }