From f68520bc49e04679e6af5d4550996e293eb41372 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Tue, 20 Apr 2021 16:17:58 +0800 Subject: [PATCH] [TD-3872]: fix taosGetDiskSize statvfs input directory bug --- src/os/src/darwin/darwinSysInfo.c | 2 +- src/os/src/detail/osSysinfo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/src/darwin/darwinSysInfo.c b/src/os/src/darwin/darwinSysInfo.c index 55c07766b3..6e70043779 100644 --- a/src/os/src/darwin/darwinSysInfo.c +++ b/src/os/src/darwin/darwinSysInfo.c @@ -217,7 +217,7 @@ void taosSetCoreDump() {} int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) { struct statvfs info; - if (statvfs(tsDataDir, &info)) { + if (statvfs(dataDir, &info)) { uError("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); return -1; diff --git a/src/os/src/detail/osSysinfo.c b/src/os/src/detail/osSysinfo.c index c0d46878a8..bbda08aa25 100644 --- a/src/os/src/detail/osSysinfo.c +++ b/src/os/src/detail/osSysinfo.c @@ -319,7 +319,7 @@ bool taosGetCpuUsage(float *sysCpuUsage, float *procCpuUsage) { int32_t taosGetDiskSize(char *dataDir, SysDiskSize *diskSize) { struct statvfs info; - if (statvfs(tsDataDir, &info)) { + if (statvfs(dataDir, &info)) { uError("failed to get disk size, dataDir:%s errno:%s", tsDataDir, strerror(errno)); terrno = TAOS_SYSTEM_ERROR(errno); return -1; -- GitLab