From 1178184e96b4748f552a7904682ae1b7804e3edc Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Mon, 7 Jul 2025 15:15:44 +0200 Subject: [PATCH] crypto/threads_lock_contention: condition file suffix on FIPS_MODULE and not fopen() call MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Eugene Syromiatnikov Reviewed-by: Neil Horman Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/27983) --- crypto/threads_pthread.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c index ed04c54359a..e419f210832 100644 --- a/crypto/threads_pthread.c +++ b/crypto/threads_pthread.c @@ -637,13 +637,14 @@ struct stack_traces { struct stack_info stacks[STACKS_COUNT]; }; -static void init_contention_fp_once(void) -{ # ifdef FIPS_MODULE - contention_fp = fopen("lock-contention-log-fips.txt", "w"); +# define FIPS_SFX "-fips" # else - contention_fp = fopen("lock-contention-log.txt", "w"); +# define FIPS_SFX "" # endif +static void init_contention_fp_once(void) +{ + contention_fp = fopen("lock-contention-log" FIPS_SFX ".txt", "w"); if (contention_fp == NULL) fprintf(stderr, "Contention log file could not be opened, log will not be recorded\n"); -- 2.47.3