11cb0ef41Sopenharmony_ciFrom 6f21cb4b209d750486ede5472fdf7e35cf5ac3aa Mon Sep 17 00:00:00 2001
21cb0ef41Sopenharmony_ciFrom: Ramin Halavati <rhalavati@chromium.org>
31cb0ef41Sopenharmony_ciDate: Wed, 17 May 2023 15:21:43 +0200
41cb0ef41Sopenharmony_ciSubject: [PATCH] Add open64 for Large File System support to gzlib.
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ci---
71cb0ef41Sopenharmony_ci third_party/zlib/gzlib.c | 5 ++++-
81cb0ef41Sopenharmony_ci 1 file changed, 4 insertions(+), 1 deletion(-)
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_cidiff --git a/third_party/zlib/gzlib.c b/third_party/zlib/gzlib.c
111cb0ef41Sopenharmony_ciindex 55da46a453fd1..bbdb797e8079d 100644
121cb0ef41Sopenharmony_ci--- a/third_party/zlib/gzlib.c
131cb0ef41Sopenharmony_ci+++ b/third_party/zlib/gzlib.c
141cb0ef41Sopenharmony_ci@@ -7,11 +7,14 @@
151cb0ef41Sopenharmony_ci 
161cb0ef41Sopenharmony_ci #if defined(_WIN32) && !defined(__BORLANDC__)
171cb0ef41Sopenharmony_ci #  define LSEEK _lseeki64
181cb0ef41Sopenharmony_ci+#  define OPEN  open
191cb0ef41Sopenharmony_ci #else
201cb0ef41Sopenharmony_ci #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
211cb0ef41Sopenharmony_ci #  define LSEEK lseek64
221cb0ef41Sopenharmony_ci+#  define OPEN  open64
231cb0ef41Sopenharmony_ci #else
241cb0ef41Sopenharmony_ci #  define LSEEK lseek
251cb0ef41Sopenharmony_ci+#  define OPEN  open
261cb0ef41Sopenharmony_ci #endif
271cb0ef41Sopenharmony_ci #endif
281cb0ef41Sopenharmony_ci 
291cb0ef41Sopenharmony_ci@@ -244,7 +247,7 @@ local gzFile gz_open(path, fd, mode)
301cb0ef41Sopenharmony_ci #ifdef WIDECHAR
311cb0ef41Sopenharmony_ci         fd == -2 ? _wopen(path, oflag, 0666) :
321cb0ef41Sopenharmony_ci #endif
331cb0ef41Sopenharmony_ci-        open((const char *)path, oflag, 0666));
341cb0ef41Sopenharmony_ci+        OPEN((const char *)path, oflag, 0666));
351cb0ef41Sopenharmony_ci     if (state->fd == -1) {
361cb0ef41Sopenharmony_ci         free(state->path);
371cb0ef41Sopenharmony_ci         free(state);
381cb0ef41Sopenharmony_ci-- 
391cb0ef41Sopenharmony_ci2.40.1.606.ga4b1b128d6-goog
401cb0ef41Sopenharmony_ci
41