Commit b904ea574d for openssl.org
commit b904ea574d96b492bc8705d28b6abab60e2d74c1
Author: Milan Broz <gmazyland@gmail.com>
Date: Fri Mar 27 10:39:56 2026 +0100
Define static set_cloexec() only when really used
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)
diff --git a/ssl/rio/rio_notifier.c b/ssl/rio/rio_notifier.c
index 0d84880065..ab635aa7a0 100644
--- a/ssl/rio/rio_notifier.c
+++ b/ssl/rio/rio_notifier.c
@@ -13,6 +13,7 @@
#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.
@@ -25,6 +26,7 @@ static int set_cloexec(int fd)
return 1;
#endif
}
+#endif
#if defined(OPENSSL_SYS_WINDOWS)