summaryrefslogtreecommitdiffstats
path: root/src/crypto/thread_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/thread_pthread.c')
-rw-r--r--src/crypto/thread_pthread.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/crypto/thread_pthread.c b/src/crypto/thread_pthread.c
index 59c4b8d..68aaab5 100644
--- a/src/crypto/thread_pthread.c
+++ b/src/crypto/thread_pthread.c
@@ -17,6 +17,7 @@
#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_NO_THREADS)
#include <pthread.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -74,7 +75,11 @@ void CRYPTO_STATIC_MUTEX_unlock(struct CRYPTO_STATIC_MUTEX *lock) {
}
void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)) {
- pthread_once(once, init);
+ if (pthread_once(once, init) != 0) {
+ fprintf(stderr,
+ "pthread_once failed. Did you link against a threading library?\n");
+ abort();
+ }
}
static pthread_mutex_t g_destructors_lock = PTHREAD_MUTEX_INITIALIZER;