]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
seek: fix fallback for missing ftruncate on Windows
authorMarc Hoersken <info@marc-hoersken.de>
Sat, 7 Mar 2020 09:59:27 +0000 (10:59 +0100)
committerMarc Hoersken <info@marc-hoersken.de>
Sat, 7 Mar 2020 09:59:27 +0000 (10:59 +0100)
This fixes test 198 on versions of MinGW-w64 without ftruncate

Reviewed-By: Daniel Stenberg
Reviewed-By: Marcel Raad
Closes #5055

appveyor.yml
src/tool_cb_see.c
src/tool_cb_see.h

index 9b4ad5cf5ccc58bd01547da7b3170b68cbc4afbd..25361a0b644c026195721741bba475adb4f4233e 100644 (file)
@@ -81,7 +81,7 @@ environment:
         HTTP_ONLY: OFF
         TESTING: ON
         SHARED: OFF
-        DISABLED_TESTS: "!198 !1139"
+        DISABLED_TESTS: "!1139"
         COMPILER_PATH: "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin"
         MSYS2_ARG_CONV_EXCL: "/*"
         BUILD_OPT: -k
index 99be273d1781d295e24e4cbade413c781d6b4975..a0ddc00ed1c92b71827f75aa21fb051952d69346 100644 (file)
@@ -88,7 +88,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
   return CURL_SEEKFUNC_OK;
 }
 
-#if defined(WIN32) && !defined(__MINGW64__)
+#ifdef USE_TOOL_FTRUNCATE
 
 #ifdef __BORLANDC__
 /* 64-bit lseek-like function unavailable */
@@ -129,4 +129,4 @@ int tool_ftruncate64(int fd, curl_off_t where)
   return 0;
 }
 
-#endif /* WIN32  && ! __MINGW64__ */
+#endif /* USE_TOOL_FTRUNCATE */
index fed8bbf8d3270e02ab08214f07c2f9c977932150..18ab02be4dc9ded11c8e83c5141a899a4e74b558 100644 (file)
  ***************************************************************************/
 #include "tool_setup.h"
 
-#if defined(WIN32) && !defined(__MINGW64__)
+#if defined(WIN32) && !defined(HAVE_FTRUNCATE)
 
 int tool_ftruncate64(int fd, curl_off_t where);
 
 #undef  ftruncate
 #define ftruncate(fd,where) tool_ftruncate64(fd,where)
 
-#ifndef HAVE_FTRUNCATE
-#  define HAVE_FTRUNCATE 1
-#endif
+#define HAVE_FTRUNCATE 1
+#define USE_TOOL_FTRUNCATE 1
 
-#endif /* WIN32  && ! __MINGW64__ */
+#endif /* WIN32  && ! HAVE_FTRUNCATE */
 
 /*
 ** callback for CURLOPT_SEEKFUNCTION