summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-03-08 17:04:59 +0000
committerPauli <pauli@openssl.org>2022-03-10 13:23:01 +1100
commitef59d8ab2378707da29f5a02d13df4dd9e71b2c8 (patch)
tree1d52de26c22be68d62eedc68d0b52406a5c0f796 /crypto
parent28c1ac648600be928e35c47a780b07efd8b24ad1 (diff)
Some platforms don't have pthread_atfork
We've had a report of a linker failure on some platforms (this one was linux ARM) that apparently did not have pthread_atfork. It's strange that this has not been reported before but the simplest solution is just to remove this from the library since it isn't really used anyway. Currently it is called to set up the fork handlers OPENSSL_fork_prepare, OPENSSL_fork_parent and OPENSSL_fork_child. However all of those functions are no-ops. This is a remnant from earlier code that got removed. We can safely remove it now. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17842) (cherry picked from commit 5979596247a73d1aec7310e4da0b6023ffd79623)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/threads_pthread.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 9f00d8be5e..2b7280c09c 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -261,26 +261,9 @@ int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock)
return 1;
}
# ifndef FIPS_MODULE
-# ifdef OPENSSL_SYS_UNIX
-
-static pthread_once_t fork_once_control = PTHREAD_ONCE_INIT;
-
-static void fork_once_func(void)
-{
-# ifndef OPENSSL_NO_DEPRECATED_3_0
- pthread_atfork(OPENSSL_fork_prepare,
- OPENSSL_fork_parent, OPENSSL_fork_child);
-# endif
-}
-# endif
-
int openssl_init_fork_handlers(void)
{
-# ifdef OPENSSL_SYS_UNIX
- if (pthread_once(&fork_once_control, fork_once_func) == 0)
- return 1;
-# endif
- return 0;
+ return 1;
}
# endif /* FIPS_MODULE */