mirror of
https://github.com/curl/curl.git
synced 2026-06-20 07:15:38 +03:00
seek: fix fallback for missing ftruncate on Windows
This fixes test 198 on versions of MinGW-w64 without ftruncate Reviewed-By: Daniel Stenberg Reviewed-By: Marcel Raad Closes #5055
This commit is contained in:
parent
2f4c36357b
commit
a39e5bfb96
3 changed files with 7 additions and 8 deletions
|
|
@ -81,7 +81,7 @@ environment:
|
||||||
HTTP_ONLY: OFF
|
HTTP_ONLY: OFF
|
||||||
TESTING: ON
|
TESTING: ON
|
||||||
SHARED: OFF
|
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"
|
COMPILER_PATH: "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin"
|
||||||
MSYS2_ARG_CONV_EXCL: "/*"
|
MSYS2_ARG_CONV_EXCL: "/*"
|
||||||
BUILD_OPT: -k
|
BUILD_OPT: -k
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence)
|
||||||
return CURL_SEEKFUNC_OK;
|
return CURL_SEEKFUNC_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__MINGW64__)
|
#ifdef USE_TOOL_FTRUNCATE
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
/* 64-bit lseek-like function unavailable */
|
/* 64-bit lseek-like function unavailable */
|
||||||
|
|
@ -129,4 +129,4 @@ int tool_ftruncate64(int fd, curl_off_t where)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* WIN32 && ! __MINGW64__ */
|
#endif /* USE_TOOL_FTRUNCATE */
|
||||||
|
|
|
||||||
|
|
@ -23,18 +23,17 @@
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
#include "tool_setup.h"
|
#include "tool_setup.h"
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__MINGW64__)
|
#if defined(WIN32) && !defined(HAVE_FTRUNCATE)
|
||||||
|
|
||||||
int tool_ftruncate64(int fd, curl_off_t where);
|
int tool_ftruncate64(int fd, curl_off_t where);
|
||||||
|
|
||||||
#undef ftruncate
|
#undef ftruncate
|
||||||
#define ftruncate(fd,where) tool_ftruncate64(fd,where)
|
#define ftruncate(fd,where) tool_ftruncate64(fd,where)
|
||||||
|
|
||||||
#ifndef HAVE_FTRUNCATE
|
#define HAVE_FTRUNCATE 1
|
||||||
# define HAVE_FTRUNCATE 1
|
#define USE_TOOL_FTRUNCATE 1
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* WIN32 && ! __MINGW64__ */
|
#endif /* WIN32 && ! HAVE_FTRUNCATE */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** callback for CURLOPT_SEEKFUNCTION
|
** callback for CURLOPT_SEEKFUNCTION
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue