]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove unnecessary function
authorAlan T. DeKok <aland@freeradius.org>
Mon, 4 Dec 2023 16:59:55 +0000 (11:59 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 5 Dec 2023 00:35:10 +0000 (19:35 -0500)
and use more descriptive message in the one place where the
function was used

src/lib/server/log.c
src/lib/server/log.h
src/modules/rlm_exec/rlm_exec.c

index 77ec6f91cd157c92fa31a5616765320d8f8c1344..beecd2caddfc845d6a8fce49c5c7b0ec241274b3 100644 (file)
@@ -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.
index 82acdde6d9803df33f4ee43fdd0d3031faaeb03a..6e0edcb303a8a003bd3f974515ced27ca1fceb74 100644 (file)
@@ -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));
 
index ef2c01130f4fc205bdaa1f047ad669c6502f867f..a2c11e5539eebabfb9f55fc72d8a94106dda2d16 100644 (file)
@@ -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;
        }