From: Alan T. DeKok Date: Sat, 23 Nov 2024 17:25:48 +0000 (-0500) Subject: don't mash log->file. Or, set it from the input file X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7658011c8d89bec7e077ba62fdbc28c54c8f33a1;p=thirdparty%2Ffreeradius-server.git don't mash log->file. Or, set it from the input file --- diff --git a/src/lib/util/log.c b/src/lib/util/log.c index 2598af93dce..61a8fbf7226 100644 --- a/src/lib/util/log.c +++ b/src/lib/util/log.c @@ -1089,7 +1089,13 @@ int fr_log_init_file(fr_log_t *log, char const *file) return -1; } - return fr_log_init_fp(log, fp); + if (fr_log_init_fp(log, fp) < 0) return -1; + + /* + * The init over-rode any filename, so we reset it here. + */ + log->file = file; + return 0; } /** Write complete lines to syslog