]> Savannah Git Hosting - gnulib.git/commitdiff
lseek: Fix the override to not undo the effects of AC_SYS_LARGEFILE.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Jan 2020 20:00:31 +0000 (21:00 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Jan 2020 20:00:31 +0000 (21:00 +0100)
Reported by John Donoghue <john.david.donoghue@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00146.html>.

* lib/lseek.c (rpl_lseek): When AC_SYS_LARGEFILE has enabled a 64-bit
off_t on mingw, invoke _lseeki64 instead of lseek.

ChangeLog
lib/lseek.c

index 2a1fdd684273f0589a11d9843ad4c773bdf1dea4..c70358c7f1ff5c60dc80fbc98b2dd07c035f8eec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-01-25  Bruno Haible  <bruno@clisp.org>
+
+       lseek: Fix the override to not undo the effects of AC_SYS_LARGEFILE.
+       Reported by John Donoghue <john.david.donoghue@gmail.com> in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00146.html>.
+       * lib/lseek.c (rpl_lseek): When AC_SYS_LARGEFILE has enabled a 64-bit
+       off_t on mingw, invoke _lseeki64 instead of lseek.
+
 2020-01-25  Bruno Haible  <bruno@clisp.org>
 
        iswdigit tests: Avoid test failure on Cygwin.
index 013f665d3e0f06f5b7a20742d3fe94c9e54a3608..b24983977e1d3aa2cfd15c0b1022702934fb4928 100644 (file)
@@ -63,7 +63,7 @@ rpl_lseek (int fd, off_t offset, int whence)
       return -1;
     }
 #endif
-#if _GL_WINDOWS_64_BIT_OFF_T
+#if _GL_WINDOWS_64_BIT_OFF_T || (defined __MINGW32__ && defined _FILE_OFFSET_BITS && (_FILE_OFFSET_BITS == 64))
   return _lseeki64 (fd, offset, whence);
 #else
   return lseek (fd, offset, whence);