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 <davidben@chromium.org> Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
parent
9867b7dca2
commit
cf81b540ce
@ -17,7 +17,6 @@
|
|||||||
#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_NO_THREADS)
|
#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_NO_THREADS)
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -76,8 +75,6 @@ void CRYPTO_STATIC_MUTEX_unlock(struct CRYPTO_STATIC_MUTEX *lock) {
|
|||||||
|
|
||||||
void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) {
|
void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) {
|
||||||
if (pthread_once(once, init) != 0) {
|
if (pthread_once(once, init) != 0) {
|
||||||
fprintf(stderr,
|
|
||||||
"pthread_once failed. Did you link against a threading library?\n");
|
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user