From b3085f24a2f5770d38dca0c7379bcf21069535e7 Mon Sep 17 00:00:00 2001 From: afwerar <1296468573@qq.com> Date: Mon, 22 Aug 2022 18:32:58 +0800 Subject: [PATCH] os: fix fseek error --- source/os/src/osFile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index 6c8e949b25..2d9cfe3246 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -440,10 +440,10 @@ int64_t taosPReadFile(TdFilePtr pFile, void *buf, int64_t count, int64_t offset) #endif assert(pFile->fd >= 0); // Please check if you have closed the file. #ifdef WINDOWS - size_t pos = _lseek(pFile->fd, 0, SEEK_CUR); - _lseek(pFile->fd, offset, SEEK_SET); + size_t pos = _lseeki64(pFile->fd, 0, SEEK_CUR); + _lseeki64(pFile->fd, offset, SEEK_SET); int64_t ret = _read(pFile->fd, buf, count); - _lseek(pFile->fd, pos, SEEK_SET); + _lseeki64(pFile->fd, pos, SEEK_SET); #else int64_t ret = pread(pFile->fd, buf, count, offset); #endif @@ -493,7 +493,7 @@ int64_t taosLSeekFile(TdFilePtr pFile, int64_t offset, int32_t whence) { #endif assert(pFile->fd >= 0); // Please check if you have closed the file. #ifdef WINDOWS - int64_t ret = _lseek(pFile->fd, offset, whence); + int64_t ret = _lseeki64(pFile->fd, offset, whence); #else int64_t ret = lseek(pFile->fd, offset, whence); #endif @@ -637,7 +637,7 @@ int64_t taosFSendFile(TdFilePtr pFileOut, TdFilePtr pFileIn, int64_t *offset, in #ifdef WINDOWS - _lseek(pFileIn->fd, (int32_t)(*offset), 0); + _lseeki64(pFileIn->fd, *offset, 0); int64_t writeLen = 0; uint8_t buffer[_SEND_FILE_STEP_] = {0};