From 2319751c627bdff8d4c08f98e628564729049231 Mon Sep 17 00:00:00 2001 From: minfrin Date: Fri, 22 Jan 2021 13:54:22 +0000 Subject: [PATCH 1/2] Add human readable name of chain state to info message. The message "chain state forced to 1 due to prior result found" contains an internal enum index rather than the name of the chain state. Replace with the human readable meaning. --- openarc/openarc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/openarc/openarc.c b/openarc/openarc.c index f2d6f2bf..4b2e9340 100644 --- a/openarc/openarc.c +++ b/openarc/openarc.c @@ -3526,9 +3526,12 @@ mlfi_eom(SMFICTX *ctx) if (conf->conf_dolog) { syslog(LOG_INFO, - "%s: chain state forced to %d due to prior result found", + "%s: chain state forced to \"%s\" due to prior result found", afc->mctx_jobid, - cv); + cv == ARC_CHAIN_PASS ? "pass" : + cv == ARC_CHAIN_FAIL ? "fail" : + cv == ARC_CHAIN_NONE ? "none" : + "unknown"); } arc_set_cv(afc->mctx_arcmsg, From 9d5577dc95b503d36622292491a36efc8ed030f2 Mon Sep 17 00:00:00 2001 From: minfrin Date: Sun, 24 Jan 2021 22:00:08 +0000 Subject: [PATCH 2/2] Use arc_chain_str() instead of first principles. --- openarc/openarc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/openarc/openarc.c b/openarc/openarc.c index 4b2e9340..e9f711ab 100644 --- a/openarc/openarc.c +++ b/openarc/openarc.c @@ -3523,19 +3523,15 @@ mlfi_eom(SMFICTX *ctx) break; } + arc_set_cv(afc->mctx_arcmsg, + cv); + if (conf->conf_dolog) { syslog(LOG_INFO, "%s: chain state forced to \"%s\" due to prior result found", - afc->mctx_jobid, - cv == ARC_CHAIN_PASS ? "pass" : - cv == ARC_CHAIN_FAIL ? "fail" : - cv == ARC_CHAIN_NONE ? "none" : - "unknown"); + afc->mctx_jobid, arc_chain_str(afc->mctx_arcmsg)); } - - arc_set_cv(afc->mctx_arcmsg, - cv); } arcf_dstring_printf(afc->mctx_tmpstr,