summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 979c709)
raw | patch | inline | side by side (parent: 979c709)
author | Florian Forster <octo@collectd.org> | |
Fri, 21 Nov 2014 09:39:50 +0000 (10:39 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 6 Jul 2015 12:07:10 +0000 (14:07 +0200) |
src/mqtt.c | patch | blob | history |
diff --git a/src/mqtt.c b/src/mqtt.c
index b7f5de84e8a9a46c6459ca9b7c1c9df9d6fcfbf3..c5254375867c38b90a5947fc61affcd54e2b0e02 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
status = mosquitto_reconnect (conf->mosq);
if (status != MOSQ_ERR_SUCCESS)
{
+ char errbuf[1024];
ERROR ("mqtt_connect_broker: mosquitto_connect failed: %s",
- (status == MOSQ_ERR_ERRNO ?
- strerror(errno) : mosquitto_strerror (status)));
+ (status == MOSQ_ERR_ERRNO)
+ ? sstrerror(errno, errbuf, sizeof (errbuf))
+ : mosquitto_strerror (status));
return (-1);
}
conf->connected = 1;
c_release (LOG_INFO,
- &conf->complaint_cantpublish,
- "mqtt plugin: successfully reconnected to broker \"%s:%d\"",
- conf->host, conf->port);
+ &conf->complaint_cantpublish,
+ "mqtt plugin: successfully reconnected to broker \"%s:%d\"",
+ conf->host, conf->port);
return (0);
} /* mqtt_reconnect_broker */