diff options
author | Mat <mberchtold@gmail.com> | 2016-04-01 02:00:03 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-04-02 22:56:09 +0200 |
commit | 6b888643105e37d340d509b98023b4779653c8a7 (patch) | |
tree | 247c9768aa9f6cabe827a409011d8333f43fc54f /crypto/threads_win.c | |
parent | apps/opt.c: next was only used when NDEBUG undefined, move it inside guard (diff) | |
download | openssl-6b888643105e37d340d509b98023b4779653c8a7.tar.xz openssl-6b888643105e37d340d509b98023b4779653c8a7.zip |
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/threads_win.c b/crypto/threads_win.c index 5a14872d1c..63647a39a6 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 |