From c312896d73f28c00ff2d86ef4371dfe2a1d2391c Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Fri, 8 Nov 2024 10:31:48 +0800 Subject: [PATCH] feat: set correct rsp code. --- source/common/src/rsync.c | 1 + source/os/src/osSemaphore.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/common/src/rsync.c b/source/common/src/rsync.c index ecf7fc21a6..15c296d730 100644 --- a/source/common/src/rsync.c +++ b/source/common/src/rsync.c @@ -130,6 +130,7 @@ void stopRsync() { if (code == 0) { int32_t ret = tsnprintf(buf, tListLen(buf), "kill -9 %d", pid); if (ret > 0) { + uInfo("kill rsync program pid:%d", pid); system(buf); } } diff --git a/source/os/src/osSemaphore.c b/source/os/src/osSemaphore.c index ff3d7e2976..58c832af89 100644 --- a/source/os/src/osSemaphore.c +++ b/source/os/src/osSemaphore.c @@ -276,7 +276,11 @@ int32_t taosGetPIdByName(const char* name, int32_t* pPId) { } } - return 0; + if ((*pPId) == -1) { + return TAOS_SYSTEM_ERROR(ESRCH); + } else { + return TSDB_CODE_SUCCESS; + } } int32_t tsem_init(tsem_t* psem, int flags, unsigned int count) {