From: Marc Fournier Date: Thu, 25 Feb 2016 10:22:18 +0000 (+0100) Subject: modbus: avoid enabling libmodbus's debug flag by default X-Git-Tag: collectd-5.5.2~6^2~41^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c6ec7654302659415defe4f497384ea0edc15e98;p=collectd.git modbus: avoid enabling libmodbus's debug flag by default Having this enabled makes collectd's stdout and stderr very noisy. From now on, only activate this flag when collectd is built with --enable-debug. Thanks to Eric Sandeen for mentioning this problem on IRC. --- diff --git a/src/modbus.c b/src/modbus.c index b5d1e251..7349dc56 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -288,7 +288,9 @@ static int mb_init_connection (mb_host_t *host) /* {{{ */ if (host == NULL) return (EINVAL); +#if COLLECT_DEBUG modbus_set_debug (&host->connection, 1); +#endif /* We'll do the error handling ourselves. */ modbus_set_error_handling (&host->connection, NOP_ON_ERROR); @@ -341,7 +343,9 @@ static int mb_init_connection (mb_host_t *host) /* {{{ */ return (-1); } +#if COLLECT_DEBUG modbus_set_debug (host->connection, 1); +#endif /* We'll do the error handling ourselves. */ modbus_set_error_recovery (host->connection, 0);