diff --git a/src/sniffer.c b/src/sniffer.c index 44c14be25..d82516182 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -129,8 +129,8 @@ BOOL APIENTRY DllMain( HMODULE hModule, #endif /* _WIN32 */ -static int TraceOn = 0; /* Trace is off by default */ -static FILE* TraceFile = 0; +static WOLFSSL_SHARED int TraceOn = 0; /* Trace is off by default */ +static WOLFSSL_SHARED FILE* TraceFile = 0; /* windows uses .rc table for this */ @@ -4077,12 +4077,15 @@ int ssl_FreeZeroDecodeBuffer(byte** data, int sz, char* error) int ssl_Trace(const char* traceFile, char* error) { if (traceFile) { - TraceFile = fopen(traceFile, "a"); - if (!TraceFile) { - SetError(BAD_TRACE_FILE_STR, error, NULL, 0); - return -1; + /* Don't try to reopen the file */ + if (TraceFile == NULL) { + TraceFile = fopen(traceFile, "a"); + if (!TraceFile) { + SetError(BAD_TRACE_FILE_STR, error, NULL, 0); + return -1; + } + TraceOn = 1; } - TraceOn = 1; } else TraceOn = 0; diff --git a/tests/api.c b/tests/api.c index ab95d98a4..f966bf207 100644 --- a/tests/api.c +++ b/tests/api.c @@ -18548,6 +18548,7 @@ static void test_wc_PemToDer(void) if (cert_buf) free(cert_buf); + printf(resultFmt, passed); #endif } @@ -18564,6 +18565,7 @@ static void test_wc_AllocDer(void) AssertIntEQ(ret, 0); AssertNotNull(pDer); wc_FreeDer(&pDer); + printf(resultFmt, passed); #endif } diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index 680e3a6d8..e9af1a756 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -720,6 +720,15 @@ WOLFSSL_API int wolfCrypt_Cleanup(void); will use dynamic buffer if not big enough */ #endif +#ifdef HAVE_CAVIUM_OCTEON + /* By default, the OCTEON's global variables are all thread local. This + * tag allows them to be shared between threads. */ + #include "cvmx-platform.h" + #define WOLFSSL_SHARED CVMX_SHARED +#else + #define WOLFSSL_SHARED +#endif + #ifdef __cplusplus } /* extern "C" */