summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0d1ec3)
raw | patch | inline | side by side (parent: a0d1ec3)
author | Fabien Wernli <cpan@faxm0dem.org> | |
Tue, 15 May 2012 11:59:10 +0000 (13:59 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 25 May 2013 09:05:32 +0000 (11:05 +0200) |
Change-Id: I1b7520442d7663d5bc2529369e27e3e858fe2168
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
src/modbus.c | patch | blob | history |
diff --git a/src/modbus.c b/src/modbus.c
index b5bd75b591eb143f22373c205ce21a13698aebd6..f40258d09c4b3f0c472bc3e1ee343a108ed1e859 100644 (file)
--- a/src/modbus.c
+++ b/src/modbus.c
/* num_registers = */ values_num, /* buffer = */ values);
if (status != values_num)
{
- ERROR ("Modbus plugin: modbus_read_registers (%s) failed. "
- "Giving up.", host->host);
+ ERROR ("Modbus plugin: modbus_read_registers (%s/%s) failed. status = %i, values_num = %i "
+ "Giving up.", host->host, host->node, status, values_num);
+#if LEGACY_LIBMODBUS
+ modbus_close (&host->connection);
+#else
+ modbus_close (host->connection);
+ modbus_free (host->connection);
+#endif
+ host->connection = NULL;
return (-1);
}