From cf81b540ce938f43308eb37ab2ab6ee726c8f122 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Tue, 29 Dec 2015 12:02:59 -1000 Subject: [PATCH] Remove call to |fprintf| in |CRYPTO_once|. The |fprintf| dependency is quite heavyweight for small targets. Also, using |fprintf| on a closed file dsecriptor is undefined behavior, and there's no way that this code can know whether |stderr| has already been closed. So, just don't do it. Change-Id: I1277733afe0649ae1324d11cac84826a1056e308 Reviewed-on: https://boringssl-review.googlesource.com/6812 Reviewed-by: David Benjamin Reviewed-by: David Benjamin --- crypto/thread_pthread.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/crypto/thread_pthread.c b/crypto/thread_pthread.c index 68aaab5b..2a1c9f8a 100644 --- a/crypto/thread_pthread.c +++ b/crypto/thread_pthread.c @@ -17,7 +17,6 @@ #if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_NO_THREADS) #include -#include #include #include @@ -76,8 +75,6 @@ void CRYPTO_STATIC_MUTEX_unlock(struct CRYPTO_STATIC_MUTEX *lock) { void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) { if (pthread_once(once, init) != 0) { - fprintf(stderr, - "pthread_once failed. Did you link against a threading library?\n"); abort(); } }