From 72fd885f4ff423d5351e3387867f2415f1ffc2d8 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:20:05 +0100 Subject: Transform output format to a global state This commit removes the format parameter from the mp_check object and creates a module global variable instead. This prevents thread safe usage of different mp_check objects which should likely not present a big problem for now. The reason for this change is effectively the very same, the format was lost if an exit was triggered by a signal handler (timeout in this example). --- plugins/check_swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/check_swap.c') diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 4d3b6099..cb95949a 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -93,7 +93,7 @@ int main(int argc, char **argv) { double percent_used; mp_check overall = mp_check_init(); if (config.output_format_is_set) { - overall.format = config.output_format; + mp_set_format(config.output_format); } mp_subcheck sc1 = mp_subcheck_init(); sc1 = mp_set_subcheck_default_state(sc1, STATE_OK); -- cgit v1.2.3-74-g34f1