Merge pull request #1561 from mfournier/modbus-set-debug
authorRuben Kerkhof <ruben@tilaa.nl>
Fri, 26 Feb 2016 16:37:47 +0000 (17:37 +0100)
committerRuben Kerkhof <ruben@tilaa.nl>
Fri, 26 Feb 2016 16:37:47 +0000 (17:37 +0100)
modbus: avoid enabling libmodbus's debug flag by default

src/modbus.c

index b5d1e25..7349dc5 100644 (file)
@@ -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);