From: Antonio Russo Date: Tue, 16 Feb 2016 19:22:48 +0000 (-0800) Subject: Suppress successful putval responses to exec plugin X-Git-Tag: collectd-5.6.0~357^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=53de2cf4354da65843104ea430d6fdf0375a0c64;p=collectd.git Suppress successful putval responses to exec plugin exec plugins are never supposed to receive responses to putval commands. These responses are instead sent to STDOUT, which is often attached to /dev/null. Newer init systems, such as systemd, instead log these responses. This patch preserves the expected behavior by suppressing the response if and only if the destination is STDOUT. --- diff --git a/src/utils_cmd_putval.c b/src/utils_cmd_putval.c index 7b0258c6..7b6a39d7 100644 --- a/src/utils_cmd_putval.c +++ b/src/utils_cmd_putval.c @@ -217,7 +217,8 @@ int handle_putval (FILE *fh, char *buffer) } /* while (*buffer != 0) */ /* Done parsing the options. */ - print_to_socket (fh, "0 Success: %i %s been dispatched.\n", + if (fh!=stdout) + print_to_socket (fh, "0 Success: %i %s been dispatched.\n", values_submitted, (values_submitted == 1) ? "value has" : "values have");