]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/threads_lock_contention: condition file suffix on FIPS_MODULE and not fopen...
authorEugene Syromiatnikov <esyr@openssl.org>
Mon, 7 Jul 2025 13:15:44 +0000 (15:15 +0200)
committerNeil Horman <nhorman@openssl.org>
Thu, 7 Aug 2025 15:02:51 +0000 (11:02 -0400)
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27983)

crypto/threads_pthread.c

index ed04c54359a699a90d15ff5eba8bc973a8f5cb73..e419f210832a4aa1eb3fbd2b602b5124539c6e49 100644 (file)
@@ -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");