From d4ff13d9b12b6d31f079dd5a226f375911ce3199 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 3 Nov 2020 23:12:54 +0800 Subject: [PATCH] TD-1912 --- src/os/src/detail/osFile.c | 4 ++++ src/wal/src/walWrite.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os/src/detail/osFile.c b/src/os/src/detail/osFile.c index 1cf16c998a..333ca33259 100644 --- a/src/os/src/detail/osFile.c +++ b/src/os/src/detail/osFile.c @@ -110,6 +110,10 @@ int64_t taosWrite(int32_t fd, void *buf, int64_t n) { return n; } +int64_t taosLSeek(int32_t fd, int64_t offset, int32_t whence) { + return lseek(fd, offset, whence); +} + #ifndef TAOS_OS_FUNC_FILE_SENDIFLE int64_t taosSendFile(int32_t dfd, int32_t sfd, int64_t *offset, int64_t size) { diff --git a/src/wal/src/walWrite.c b/src/wal/src/walWrite.c index 8a5911da7b..2453dcf682 100644 --- a/src/wal/src/walWrite.c +++ b/src/wal/src/walWrite.c @@ -203,7 +203,7 @@ static int32_t walSkipCorruptedRecord(SWal *pWal, SWalHead *pHead, int32_t fd, i while (1) { pos++; - if (lseek(fd, pos, SEEK_SET) < 0) { + if (taosLSeek(fd, pos, SEEK_SET) < 0) { wError("vgId:%d, failed to seek from corrupted wal file since %s", pWal->vgId, strerror(errno)); return TSDB_CODE_WAL_FILE_CORRUPTED; } -- GitLab