-int error_h(connection_t *c)
-{
- int err;
- char errorstring[MAX_STRING_SIZE];
- cp();
- if(sscanf(c->buffer, "%*d %d "MAX_STRING, &err, errorstring) != 2)
- {
- syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "ERROR",
- c->name, c->hostname);
- return -1;
- }
-
- if(debug_lvl >= DEBUG_ERROR)
- {
- syslog(LOG_NOTICE, _("Error message from %s (%s): %s: %s"),
- c->name, c->hostname, strerror(err), errorstring);
- }
-
- terminate_connection(c, c->status.active);
- cp();
- return 0;
+bool error_h(connection_t *c) {
+ int err;
+ char errorstring[MAX_STRING_SIZE];
+
+ if(sscanf(c->buffer, "%*d %d " MAX_STRING, &err, errorstring) != 2) {
+ logger(LOG_ERR, "Got bad %s from %s (%s)", "ERROR",
+ c->name, c->hostname);
+ return false;
+ }
+
+ ifdebug(ERROR) logger(LOG_NOTICE, "Error message from %s (%s): %d: %s",
+ c->name, c->hostname, err, errorstring);
+
+ terminate_connection(c, c->status.active);
+
+ return true;