diff --git a/source/os/src/osFile.c b/source/os/src/osFile.c index 0baffcbad6..5ad814c043 100644 --- a/source/os/src/osFile.c +++ b/source/os/src/osFile.c @@ -456,8 +456,7 @@ int64_t taosPReadFile(TdFilePtr pFile, void *buf, int64_t count, int64_t offset) return -1; } #ifdef WINDOWS - int64_t ret = 0; - + int64_t ret = 0; OVERLAPPED ol = {0}; ol.OffsetHigh = (uint32_t)((offset & 0xFFFFFFFF00000000LL) >> 0x20); ol.Offset = (uint32_t)(offset & 0xFFFFFFFFLL); @@ -465,7 +464,6 @@ int64_t taosPReadFile(TdFilePtr pFile, void *buf, int64_t count, int64_t offset) HANDLE handle = (HANDLE)_get_osfhandle(pFile->fd); SetLastError(0); bool result = ReadFile(handle, buf, count, &ret, &ol); - if (!result && GetLastError() != ERROR_HANDLE_EOF) { errno = GetLastError(); return -1; @@ -533,8 +531,7 @@ int64_t taosPWriteFile(TdFilePtr pFile, const void *buf, int64_t count, int64_t return 0; } #ifdef WINDOWS - int64_t ret = 0; - + int64_t ret = 0; OVERLAPPED ol = {0}; pl.OffsetHigh = (uint32_t)((offset & 0xFFFFFFFF00000000LL) >> 0x20); pl.Offset = (uint32_t)(offset & 0xFFFFFFFFLL);