From: Alan T. DeKok Date: Mon, 4 Dec 2023 16:59:55 +0000 (-0500) Subject: remove unnecessary function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb2ffe47fbf3db2719b8498a981f239422451445;p=thirdparty%2Ffreeradius-server.git remove unnecessary function and use more descriptive message in the one place where the function was used --- diff --git a/src/lib/server/log.c b/src/lib/server/log.c index 77ec6f91cd1..beecd2caddf 100644 --- a/src/lib/server/log.c +++ b/src/lib/server/log.c @@ -587,21 +587,6 @@ void vlog_module_failure_msg(request_t *request, char const *fmt, va_list ap) talloc_free(p); } -/** Add a module failure message fr_pair_tE to the request - * - * @param[in] request The current request. - * @param[in] fmt with printf style substitution tokens. - * @param[in] ... Substitution arguments. - */ -void log_module_failure_msg(request_t *request, char const *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vlog_module_failure_msg(request, fmt, ap); - va_end(ap); -} - /** Marshal variadic log arguments into a va_list and pass to normal logging functions * * @see log_request_error for more details. diff --git a/src/lib/server/log.h b/src/lib/server/log.h index 82acdde6d98..6e0edcb303a 100644 --- a/src/lib/server/log.h +++ b/src/lib/server/log.h @@ -110,9 +110,6 @@ void log_request(fr_log_type_t type, fr_log_lvl_t lvl, request_t *request, char const *fmt, ...) CC_HINT(format (printf, 6, 7)) CC_HINT(nonnull (3, 6)); -void log_module_failure_msg(request_t *request, char const *fmt, ...) - CC_HINT(format (printf, 2, 3)); - void vlog_module_failure_msg(request_t *request, char const *fmt, va_list ap) CC_HINT(format (printf, 2, 0)); diff --git a/src/modules/rlm_exec/rlm_exec.c b/src/modules/rlm_exec/rlm_exec.c index ef2c01130f4..a2c11e5539e 100644 --- a/src/modules/rlm_exec/rlm_exec.c +++ b/src/modules/rlm_exec/rlm_exec.c @@ -215,15 +215,13 @@ static rlm_rcode_t rlm_exec_status2rcode(request_t *request, fr_value_box_t *box if (status > 9) { REDEBUG("Program returned invalid code (greater than max rcode) (%i > 9): %pV", status, box); - goto fail; + return RLM_MODULE_FAIL; } rcode = status2rcode[status]; if (rcode == RLM_MODULE_FAIL) { - fail: - - if (box) log_module_failure_msg(request, "%pV", box); + if (box) RDEBUG(request, "Program failed with output: %pV", box); return RLM_MODULE_FAIL; }