[openssl-commits] [openssl] OpenSSL_1_1_0-stable update

Richard Levitte levitte at openssl.org
Fri Jan 13 12:11:02 UTC 2017


The branch OpenSSL_1_1_0-stable has been updated
       via  ba2efdc9ed75659a75d8b8c3cd4ae5bd3c181c65 (commit)
      from  08c2da0d6a19b5b9a501ff93641cb2ece5b6b6f0 (commit)


- Log -----------------------------------------------------------------
commit ba2efdc9ed75659a75d8b8c3cd4ae5bd3c181c65
Author: Richard Levitte <levitte at openssl.org>
Date:   Thu Jan 12 23:13:17 2017 +0100

    Clarify what RUN_ONCE returns
    
    RUN_ONCE really just returns 0 on failure or whatever the init
    function returned.  By convention, however, the init function must
    return 0 on failure and 1 on success.  This needed to be clarified.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/2225)
    (cherry picked from commit 37b8f1e21c56996644afa38816f575b05eb483ae)

-----------------------------------------------------------------------

Summary of changes:
 include/internal/thread_once.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/internal/thread_once.h b/include/internal/thread_once.h
index 74f6ccb..2242443 100644
--- a/include/internal/thread_once.h
+++ b/include/internal/thread_once.h
@@ -34,9 +34,12 @@
  * RUN_ONCE - use CRYPTO_THREAD_run_once, and check if the init succeeded
  * @once: pointer to static object of type CRYPTO_ONCE
  * @init: function name that was previously given to DEFINE_RUN_ONCE,
- *        DEFINE_RUN_ONCE_STATIC or DECLARE_RUN_ONCE.
+ *        DEFINE_RUN_ONCE_STATIC or DECLARE_RUN_ONCE.  This function
+ *        must return 1 for success or 0 for failure.
  *
- * The return value is 1 on success or 0 in case of error.
+ * The return value is 1 on success (*) or 0 in case of error.
+ *
+ * (*) by convention, since the init function must return 1 on success.
  */
 #define RUN_ONCE(once, init)                                            \
     (CRYPTO_THREAD_run_once(once, init##_ossl_) ? init##_ossl_ret_ : 0)


More information about the openssl-commits mailing list