fix unit test case that causes core dump

This commit is contained in:
slzhou 2022-04-22 08:45:38 +08:00
parent 49dc204076
commit a01f1a4e1d
1 changed files with 6 additions and 2 deletions

View File

@ -236,8 +236,12 @@ static int32_t dmSpawnUdfd(SDnode *pDnode) {
uv_process_options_t options = {0};
char path[PATH_MAX] = {0};
strncpy(path, tsProcPath, strlen(tsProcPath));
char* dirName = taosDirName(path);
if (tsProcPath == NULL) {
path[0] = '.';
} else {
strncpy(path, tsProcPath, strlen(tsProcPath));
taosDirName(path);
}
strcat(path, "/udfd");
char* argsUdfd[] = {path, "-c", configDir, NULL};
options.args = argsUdfd;