fix(util): check return value.

This commit is contained in:
Haojun Liao 2024-11-08 12:48:00 +08:00
parent c312896d73
commit d8098ab3e1
1 changed files with 2 additions and 2 deletions

View File

@ -263,7 +263,7 @@ int32_t taosGetPIdByName(const char* name, int32_t* pPId) {
fp = fopen(filepath, "r");
if (NULL != fp) {
if (fgets(buf, tListLen(buf) - 1, fp) == NULL) {
fclose(fp);
TAOS_UNUSED(fclose(fp));
continue;
}
@ -272,7 +272,7 @@ int32_t taosGetPIdByName(const char* name, int32_t* pPId) {
char* end = NULL;
*pPId = taosStr2Int32(ptr->d_name, &end, 10);
}
fclose(fp);
TAOS_UNUSED(fclose(fp));
}
}