From: Florian Forster Date: Sat, 14 Nov 2009 09:14:26 +0000 (+0100) Subject: erlang plugin: Improve handling of communication errors. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=23a1f23b0628a48df6c56fcf94c783536b382eb2;p=collectd.git erlang plugin: Improve handling of communication errors. --- diff --git a/src/erlang.c b/src/erlang.c index 97286140..65d8f9ea 100644 --- a/src/erlang.c +++ b/src/erlang.c @@ -551,22 +551,22 @@ static int handle_dispatch_values (ce_connection_info_t *cinfo, /* {{{ */ if (status != 0) { free (vl.values); - send_error (cinfo->fd, req->from, "Cannot parse argument as value list."); - return (0); + status = send_error (cinfo->fd, req->from, "Cannot parse argument as value list."); + return (status); } status = plugin_dispatch_values (&vl); if (status != 0) { free (vl.values); - send_error (cinfo->fd, req->from, "plugin_dispatch_values failed."); - return (0); + status = send_error (cinfo->fd, req->from, "plugin_dispatch_values failed."); + return (status); } free (vl.values); - send_atom (cinfo->fd, req->from, "success"); + status = send_atom (cinfo->fd, req->from, "success"); - return (0); + return (status); } /* }}} int handle_dispatch_values */ /* Returns non-zero only if the request could not be handled gracefully. */