From 38c28f1cb696547344403a70d5f6a8379e670228 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 3 Nov 2020 20:27:07 +0800 Subject: [PATCH] TD-1912 --- src/os/inc/osFile.h | 8 ++++---- src/wal/src/walWrite.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/os/inc/osFile.h b/src/os/inc/osFile.h index 57d2a4886a..42426c366a 100644 --- a/src/os/inc/osFile.h +++ b/src/os/inc/osFile.h @@ -20,10 +20,10 @@ extern "C" { #endif -#define treadfile(fd, buf, count) read(fd, buf, count) -#define twritefile(fd, buf, count) write(fd, buf, count) -#define tlseekfile(fd, offset, whence) lseek(fd, offset, whence) -#define tclosefile(fd) \ +#define tread(fd, buf, count) read(fd, buf, count) +#define twrite(fd, buf, count) write(fd, buf, count) +#define tlseek(fd, offset, whence) lseek(fd, offset, whence) +#define tclose(fd) \ { \ if (FD_VALID(x)) { \ close(x); \ diff --git a/src/wal/src/walWrite.c b/src/wal/src/walWrite.c index 304b2f1cb7..0ef8f888c5 100644 --- a/src/wal/src/walWrite.c +++ b/src/wal/src/walWrite.c @@ -37,7 +37,7 @@ int32_t walRenew(void *handle) { pthread_mutex_lock(&pWal->mutex); if (pWal->fd >= 0) { - close(pWal->fd); + tclose(pWal->fd); wDebug("vgId:%d, file:%s, it is closed", pWal->vgId, pWal->name); } @@ -310,7 +310,7 @@ static int32_t walRestoreWalFile(SWal *pWal, void *pVnode, FWalWrite writeFp, ch (*writeFp)(pVnode, pHead, TAOS_QTYPE_WAL); } - close(fd); + tclose(fd); tfree(buffer); return code; -- GitLab