summaryrefslogtreecommitdiff
path: root/crypto/err/err_prn.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2010-01-27 11:14:46 +0000
committerRichard Levitte <levitte@openssl.org>2010-01-27 11:14:46 +0000
commite6d8d6a89ae491106ff5860bcd339f1469ca350f (patch)
treebf5eb7cff5c855f24213c665470d57d9bc96b969 /crypto/err/err_prn.c
parent0e785e5e093d4c24eaf531dd5ffc655e3a91c6b5 (diff)
downloadopenssl-new-e6d8d6a89ae491106ff5860bcd339f1469ca350f.tar.gz
Merge main -> VMS_64BITBRANCH_VMS_64BIT
Diffstat (limited to 'crypto/err/err_prn.c')
-rw-r--r--crypto/err/err_prn.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c
index 81e34bd6ce..de32f332c4 100644
--- a/crypto/err/err_prn.c
+++ b/crypto/err/err_prn.c
@@ -57,9 +57,9 @@
*/
#include <stdio.h>
+#include "cryptlib.h"
#include <openssl/lhash.h>
#include <openssl/crypto.h>
-#include "cryptlib.h"
#include <openssl/buffer.h>
#include <openssl/err.h>
@@ -72,8 +72,10 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
const char *file,*data;
int line,flags;
unsigned long es;
+ CRYPTO_THREADID cur;
- es=CRYPTO_thread_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);
@@ -86,7 +88,12 @@ void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u),
#ifndef OPENSSL_NO_FP_API
static int print_fp(const char *str, size_t len, void *fp)
{
- return fprintf((FILE *)fp, "%s", str);
+ BIO bio;
+
+ BIO_set(&bio,BIO_s_file());
+ BIO_set_fp(&bio,fp,BIO_NOCLOSE);
+
+ return BIO_printf(&bio, "%s", str);
}
void ERR_print_errors_fp(FILE *fp)
{