fix: unlock before return
This commit is contained in:
parent
70704ee906
commit
42c83d8f87
|
@ -466,7 +466,7 @@ int64_t taosPReadFile(TdFilePtr pFile, void *buf, int64_t count, int64_t offset)
|
|||
BOOL result = ReadFile(handle, buf, count, &ret, &ol);
|
||||
if (!result && GetLastError() != ERROR_HANDLE_EOF) {
|
||||
errno = GetLastError();
|
||||
return -1;
|
||||
ret = -1;
|
||||
}
|
||||
#else
|
||||
int64_t ret = pread(pFile->fd, buf, count, offset);
|
||||
|
@ -541,7 +541,7 @@ int64_t taosPWriteFile(TdFilePtr pFile, const void *buf, int64_t count, int64_t
|
|||
BOOL result = WriteFile(handle, buf, count, &ret, &ol);
|
||||
if (!result) {
|
||||
errno = GetLastError();
|
||||
return -1;
|
||||
ret = -1;
|
||||
}
|
||||
#else
|
||||
int64_t ret = pwrite(pFile->fd, buf, count, offset);
|
||||
|
|
Loading…
Reference in New Issue