diff options
author | AlexSm <alex@ydb.tech> | 2024-01-18 11:28:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-18 11:28:56 +0100 |
commit | 9d0a3761b3201e0d9db879a7adf91876ebdb0564 (patch) | |
tree | 541d11ac878c18efd7ebca81e35112aa0fef995b /contrib/libs/curl/src/tool_cb_see.c | |
parent | 404ef8886ecc9736bc58ade6da2fbd83b486a408 (diff) | |
download | ydb-9d0a3761b3201e0d9db879a7adf91876ebdb0564.tar.gz |
Library import 8 (#1074)
* Library import 8
* Add contrib/libs/cxxsupp/libcxx/include/__verbose_abort
Diffstat (limited to 'contrib/libs/curl/src/tool_cb_see.c')
-rw-r--r-- | contrib/libs/curl/src/tool_cb_see.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/contrib/libs/curl/src/tool_cb_see.c b/contrib/libs/curl/src/tool_cb_see.c index d24d526518..bce57bb281 100644 --- a/contrib/libs/curl/src/tool_cb_see.c +++ b/contrib/libs/curl/src/tool_cb_see.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -28,6 +28,7 @@ #include "curlx.h" #include "tool_cfgable.h" +#include "tool_operate.h" #include "tool_cb_see.h" #include "memdebug.h" /* keep this as LAST include */ @@ -48,7 +49,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) { - struct InStruct *in = userdata; + struct per_transfer *per = userdata; #if(SIZEOF_CURL_OFF_T > SIZEOF_OFF_T) && !defined(USE_WIN32_LARGE_FILES) @@ -66,13 +67,13 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) /* this code path doesn't support other types */ return CURL_SEEKFUNC_FAIL; - if(LSEEK_ERROR == lseek(in->fd, 0, SEEK_SET)) + if(LSEEK_ERROR == lseek(per->infd, 0, SEEK_SET)) /* couldn't rewind to beginning */ return CURL_SEEKFUNC_FAIL; while(left) { long step = (left > OUR_MAX_SEEK_O) ? OUR_MAX_SEEK_L : (long)left; - if(LSEEK_ERROR == lseek(in->fd, step, SEEK_CUR)) + if(LSEEK_ERROR == lseek(per->infd, step, SEEK_CUR)) /* couldn't seek forwards the desired amount */ return CURL_SEEKFUNC_FAIL; left -= step; @@ -81,7 +82,7 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) } #endif - if(LSEEK_ERROR == lseek(in->fd, offset, whence)) + if(LSEEK_ERROR == lseek(per->infd, offset, whence)) /* couldn't rewind, the reason is in errno but errno is just not portable enough and we don't actually care that much why we failed. We'll let libcurl know that it may try other means if it wants to. */ @@ -92,21 +93,6 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int whence) #ifdef USE_TOOL_FTRUNCATE -#ifdef __BORLANDC__ -/* 64-bit lseek-like function unavailable */ -# define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence) -#endif - -#ifdef __POCC__ -# if(__POCC__ < 450) -/* 64-bit lseek-like function unavailable */ -# define _lseeki64(hnd,ofs,whence) _lseek(hnd,ofs,whence) -# else -# undef _lseeki64 -# define _lseeki64(hnd,ofs,whence) _lseek64(hnd,ofs,whence) -# endif -#endif - #ifdef _WIN32_WCE /* 64-bit lseek-like function unavailable */ # undef _lseeki64 |