aboutsummaryrefslogtreecommitdiff
path: root/crypto/threads_win.c
diff options
context:
space:
mode:
authorMat <mberchtold@gmail.com>2016-04-01 02:00:03 +0200
committerRich Salz <rsalz@openssl.org>2016-04-02 16:56:09 -0400
commit6b888643105e37d340d509b98023b4779653c8a7 (patch)
tree247c9768aa9f6cabe827a409011d8333f43fc54f /crypto/threads_win.c
parentb286cb8eac308b2f2350d01b8b0ccb63909a2e47 (diff)
downloadopenssl-6b888643105e37d340d509b98023b4779653c8a7.zip
openssl-6b888643105e37d340d509b98023b4779653c8a7.tar.gz
openssl-6b888643105e37d340d509b98023b4779653c8a7.tar.bz2
Fix: CRYPTO_THREAD_run_once
InitOnceExecuteOnce returns nonzero on success: MSDN: "If the function succeeds, the return value is nonzero." So return 1 if it is nonzero, 0 others. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/threads_win.c')
-rw-r--r--crypto/threads_win.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/threads_win.c b/crypto/threads_win.c
index 5a14872..63647a3 100644
--- a/crypto/threads_win.c
+++ b/crypto/threads_win.c
@@ -136,9 +136,9 @@ BOOL CALLBACK once_cb(PINIT_ONCE once, PVOID p, PVOID *pp)
int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
{
if (InitOnceExecuteOnce(once, once_cb, init, NULL))
- return 0;
+ return 1;
- return 1;
+ return 0;
}
# endif