Files
Ryan VanderMeulen ec1c424395 Bug 2067508 - define O_NONBLOCK to 0 on platforms lacking it. r=firefox-build-system-reviewers,sergesanspaille
cctz opens zoneinfo files with O_NONBLOCK, which mingw does not define, breaking all
four mingwclang builds. Mirrors the O_CLOEXEC fallback two lines above.

Merged upstream as https://github.com/google/cctz/pull/372, but abseil has not
imported it yet.

Differential Revision: https://phabricator.services.mozilla.com/D322123
2026-09-01 13:02:40 +00:00

24 lines
952 B
Diff

From: Ryan VanderMeulen <rvandermeulen@mozilla.com>
Date: Sat, 29 Aug 2026 11:23:36 -0400
Subject: Bug 2067508 - define O_NONBLOCK to 0 on platforms lacking it (mingw).
Cherry-pick of google/cctz@361e53992abb; abseil has not imported it yet.
---
abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc b/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc
index 9abbde72d62..9d385b2772c 100644
--- a/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc
+++ b/abseil-cpp/absl/time/internal/cctz/src/time_zone_info.cc
@@ -414,6 +414,9 @@ inline FilePtr FOpen(const char* path) {
// absolute path) would block indefinitely or read unbounded data.
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
+#endif
+#ifndef O_NONBLOCK
+#define O_NONBLOCK 0
#endif
const int fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (fd >= 0) {