summaryrefslogtreecommitdiffstats
path: root/crypto/err
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-03-09 10:35:53 +0000
committerMatt Caswell <matt@openssl.org>2016-03-09 12:41:39 +0000
commit2e52e7df518d80188c865ea3f7bb3526d14b0c08 (patch)
tree880dbaa15521723b5c2cd35acbbf51ea9384e66c /crypto/err
parent4fc4faa7a79c71223f326396b79af34d37da6615 (diff)
Remove the old threading API
All OpenSSL code has now been transferred to use the new threading API, so the old one is no longer used and can be removed. We provide some compat macros for removed functions which are all no-ops. There is now no longer a need to set locking callbacks!! Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/err')
-rw-r--r--crypto/err/err_prn.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c
index 955decd2d9..ac6b81f80b 100644
--- a/crypto/err/err_prn.c
+++ b/crypto/err/err_prn.c
@@ -57,6 +57,7 @@
#include <stdio.h>
#include "internal/cryptlib.h"
+#include "internal/threads.h"
#include <openssl/lhash.h>
#include <openssl/crypto.h>
#include <openssl/buffer.h>
@@ -70,14 +71,21 @@ void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
char buf2[4096];
const char *file, *data;
int line, flags;
- unsigned long es;
- CRYPTO_THREADID cur;
+ /*
+ * We don't know what kind of thing CRYPTO_THREAD_ID is. Here is our best
+ * attempt to convert it into something we can print.
+ */
+ union {
+ CRYPTO_THREAD_ID tid;
+ unsigned long ltid;
+ } tid;
+
+ tid.ltid = 0;
+ tid.tid = CRYPTO_THREAD_get_current_id();
- CRYPTO_THREADID_current(&cur);
- es = CRYPTO_THREADID_hash(&cur);
while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
ERR_error_string_n(l, buf, sizeof buf);
- BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", es, buf,
+ BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", tid.ltid, buf,
file, line, (flags & ERR_TXT_STRING) ? data : "");
if (cb(buf2, strlen(buf2), u) <= 0)
break; /* abort outputting the error report */