From: Michael Tremer Date: Thu, 4 Jun 2026 15:22:06 +0000 (+0000) Subject: command: Remove return code from success callback X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=89f0621a7ae7eed4894355aa3ffad883ce6d458a;p=telemetry.git command: Remove return code from success callback It will always be zero. Signed-off-by: Michael Tremer --- diff --git a/src/daemon/command.c b/src/daemon/command.c index 6c0fab5..571a828 100644 --- a/src/daemon/command.c +++ b/src/daemon/command.c @@ -434,7 +434,7 @@ static int td_command_exited(sd_event_source* source, const siginfo_t* si, void* case 0: if (self->callbacks.on_success) { r = self->callbacks.on_success(self->ctx, - rc, stdout, self->callbacks.on_success_data); + stdout, self->callbacks.on_success_data); } break; diff --git a/src/daemon/command.h b/src/daemon/command.h index 0a9a4e9..f6bdf46 100644 --- a/src/daemon/command.h +++ b/src/daemon/command.h @@ -29,7 +29,7 @@ typedef struct td_command td_command; #include "file.h" typedef int (*td_command_success_callback) - (td_ctx* ctx, int rc, td_file* stdout, void* data); + (td_ctx* ctx, td_file* stdout, void* data); typedef int (*td_command_failure_callback) (td_ctx* ctx, int rc, td_file* stderr, void* data); diff --git a/src/daemon/sources/hostapd.c b/src/daemon/sources/hostapd.c index cd5c78d..2997c3d 100644 --- a/src/daemon/sources/hostapd.c +++ b/src/daemon/sources/hostapd.c @@ -192,8 +192,7 @@ static int hostapd_parse(td_ctx* ctx, td_file* stdout, unsigned long lineno, return td_file_parse_line(stdout, parser, line, length); } -static int hostapd_on_success(td_ctx* ctx, - int rc, td_file* stdout, void* data) { +static int hostapd_on_success(td_ctx* ctx, td_file* stdout, void* data) { td_source* source = data; int r; diff --git a/src/daemon/sources/knot-resolver.c b/src/daemon/sources/knot-resolver.c index 933968d..2d67892 100644 --- a/src/daemon/sources/knot-resolver.c +++ b/src/daemon/sources/knot-resolver.c @@ -159,8 +159,7 @@ static int knot_resolver_parse_metrics(td_ctx* ctx, return 0; } -static int knot_resolver_on_success(td_ctx* ctx, - int rc, td_file* stdout, void* data) { +static int knot_resolver_on_success(td_ctx* ctx, td_file* stdout, void* data) { sd_json_variant* json = NULL; td_metrics* metrics = NULL; td_source* source = data; diff --git a/src/daemon/sources/legacy-gateway-latency4.c b/src/daemon/sources/legacy-gateway-latency4.c index 947242d..8aecda9 100644 --- a/src/daemon/sources/legacy-gateway-latency4.c +++ b/src/daemon/sources/legacy-gateway-latency4.c @@ -37,7 +37,7 @@ #include "legacy-gateway-latency4.h" static int legacy_gateway_latency_on_success(td_ctx* ctx, - int rc, td_file* stdout, void* data) { + td_file* stdout, void* data) { td_source* source = data; double stddev = -1.0; double min = -1.0; diff --git a/src/daemon/sources/suricata.c b/src/daemon/sources/suricata.c index 95ccdb8..3913d65 100644 --- a/src/daemon/sources/suricata.c +++ b/src/daemon/sources/suricata.c @@ -133,7 +133,7 @@ static int suricata_parse_message(td_ctx* ctx, td_metrics* metrics, sd_json_vari return 0; } -static int suricata_on_success(td_ctx* ctx, int rc, td_file* stdout, void* data) { +static int suricata_on_success(td_ctx* ctx, td_file* stdout, void* data) { sd_json_variant* json = NULL; td_metrics* metrics = NULL; td_source* source = data; diff --git a/src/daemon/sources/unbound.c b/src/daemon/sources/unbound.c index f89861c..4cb33ff 100644 --- a/src/daemon/sources/unbound.c +++ b/src/daemon/sources/unbound.c @@ -27,8 +27,7 @@ #include "../source.h" #include "unbound.h" -static int unbound_on_success(td_ctx* ctx, - int rc, td_file* stdout, void* data) { +static int unbound_on_success(td_ctx* ctx, td_file* stdout, void* data) { td_source* source = data; return td_source_parse_metrics(source, NULL, stdout, METRICS(