Statically defined set_cloexec helper is used only
if RIO_NOTIFIER_METHOD_SOCKET is set (for non-Windows branch)
and if RIO_NOTIFIER_METHOD_SOCKETPAIR is set
(always).
This avoids unused code warnings.
Signed-off-by: Milan Broz <gmazyland@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Tue Mar 31 00:22:26 2026
(Merged from https://github.com/openssl/openssl/pull/30616)
#include "internal/thread_once.h"
#include "internal/rio_notifier.h"
+#if !defined(OPENSSL_SYS_WINDOWS) || RIO_NOTIFIER_METHOD == RIO_NOTIFIER_METHOD_SOCKETPAIR
/*
* Sets a socket as close-on-exec, except that this is a no-op if we are certain
* we do not need to do this or the OS does not support the concept.
return 1;
#endif
}
+#endif
#if defined(OPENSSL_SYS_WINDOWS)