--- ./src/compat-cloexec.h_orig	2025-09-03 01:27:04.058724342 -0500
+++ ./src/compat-cloexec.h	2025-09-03 01:29:07.565174683 -0500
@@ -3,11 +3,11 @@
 
 #include <rrd_config.h>
 
-#ifndef HAVE_DECL_O_CLOEXEC
+#if !defined(HAVE_DECL_O_CLOEXEC) || !HAVE_DECL_O_CLOEXEC
 #  define O_CLOEXEC 0
 #endif
 
-#ifndef HAVE_DECL_SOCK_CLOEXEC
+#if !defined(HAVE_DECL_SOCK_CLOEXEC) || !HAVE_DECL_SOCK_CLOEXEC
 #  define SOCK_CLOEXEC 0
 #endif
 
--- ./src/compat-cloexec.c_orig	2025-09-03 01:26:44.259130655 -0500
+++ ./src/compat-cloexec.c	2025-09-03 01:28:15.918525154 -0500
@@ -17,7 +17,7 @@
 
 inline static bool have_decl_o_cloexec(void)
 {
-#ifdef HAVE_DECL_O_CLOEXEC
+#if defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC
 	return true;
 #else
 	return false;
