Fix atfork flag. Avoid double-negatives :)

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/3815)
This commit is contained in:
Rich Salz 2017-06-30 13:55:08 -04:00
parent dcf6e50f48
commit b5319bdbd0
4 changed files with 5 additions and 5 deletions

View File

@ -552,7 +552,7 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
&& !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests)) && !RUN_ONCE(&add_all_digests, ossl_init_add_all_digests))
return 0; return 0;
if ((opts & OPENSSL_INIT_NO_ATFORK) == 0 if ((opts & OPENSSL_INIT_ATFORK)
&& !openssl_init_fork_handlers()) && !openssl_init_fork_handlers())
return 0; return 0;

View File

@ -30,7 +30,7 @@ such as Linux that have both functions will normally not need to call these
functions as the OpenSSL library will do so automatically. functions as the OpenSSL library will do so automatically.
L<OPENSSL_init_crypto(3)> will register these funtions with the appropriate L<OPENSSL_init_crypto(3)> will register these funtions with the appropriate
hander, unless the B<OPENSSL_INIT_NO_ATFORK> flag is used. For those hander, when the B<OPENSSL_INIT_ATFORK> flag is used. For other
applications, these functions can be called directly. They should be used applications, these functions can be called directly. They should be used
according to the calling sequence described by the pthreads_atfork(3) according to the calling sequence described by the pthreads_atfork(3)
documentation, which is summarized here. OPENSSL_fork_prepare() should documentation, which is summarized here. OPENSSL_fork_prepare() should

View File

@ -150,9 +150,9 @@ With this option the library will automatically load and initialise all the
built in engines listed above with the exception of the openssl and dasync built in engines listed above with the exception of the openssl and dasync
engines. This not a default option. engines. This not a default option.
=item OPENSSL_INIT_NO_ATFORK =item OPENSSL_INIT_ATFORK
With this option the library will not register its fork handlers. With this option the library will register its fork handlers.
See OPENSSL_fork_prepare(3) for details. See OPENSSL_fork_prepare(3) for details.
=back =back

View File

@ -370,7 +370,7 @@ int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
# define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
# define OPENSSL_INIT_ENGINE_AFALG 0x00008000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
# define OPENSSL_INIT_reserved_internal 0x00010000L # define OPENSSL_INIT_reserved_internal 0x00010000L
# define OPENSSL_INIT_NO_ATFORK 0x00020000L # define OPENSSL_INIT_ATFORK 0x00020000L
/* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */
/* Max OPENSSL_INIT flag value is 0x80000000 */ /* Max OPENSSL_INIT flag value is 0x80000000 */