diff options
author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-02-19 11:49:43 +0100 |
---|---|---|
committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-02-19 11:49:43 +0100 |
commit | 24172ca0e014454a7a6f3f1a12104175f9ff7c71 (patch) | |
tree | 82d99bae8a3c7013c12d47e1580d46e55f9c8b70 /lib | |
parent | 5acd14fcfb419c9ef0d6bc38384dde4cd6b70bd9 (diff) | |
download | monitoring-plugins-24172ca0e014454a7a6f3f1a12104175f9ff7c71.tar.gz |
Exit with 0 in JSON-format if everything else works
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/output.c b/lib/output.c index 9ba049e2..2c40bc7f 100644 --- a/lib/output.c +++ b/lib/output.c | |||
@@ -413,6 +413,10 @@ void mp_print_output(mp_check check) { puts(mp_fmt_output(check)); } | |||
413 | */ | 413 | */ |
414 | void mp_exit(mp_check check) { | 414 | void mp_exit(mp_check check) { |
415 | mp_print_output(check); | 415 | mp_print_output(check); |
416 | if (check.format == MP_FORMAT_TEST_JSON) { | ||
417 | exit(0); | ||
418 | } | ||
419 | |||
416 | exit(mp_compute_check_state(check)); | 420 | exit(mp_compute_check_state(check)); |
417 | } | 421 | } |
418 | 422 | ||