summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshiaki Takeuchi <toshiaki.takeuchi@woven-planet.global>2022-07-20 13:57:59 +0900
committerToshiaki Takeuchi <toshiaki.takeuchi@woven-planet.global>2022-07-20 14:17:22 +0900
commitbe9fc48bec8b00e5b298560285d948a6a7429740 (patch)
tree1c24b2b5c89d8386acd057bc6d04b11fb670024e
parent4bdea8fcad6ffd4bcb1bba404ebf30c344ab7dfe (diff)
fgets return should be compared with NULL not 0. Bug-AGL: SPEC-4376 Signed-off-by: Toshiaki Takeuchi <toshiaki.takeuchi@woven-planet.global>
-rwxr-xr-xservice/system/resource_manager/server/src/resm.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/service/system/resource_manager/server/src/resm.cpp b/service/system/resource_manager/server/src/resm.cpp
index 6bed6bd..f44d9b4 100755
--- a/service/system/resource_manager/server/src/resm.cpp
+++ b/service/system/resource_manager/server/src/resm.cpp
@@ -1897,7 +1897,7 @@ static void exec_perf_Resourcemanagerlog_Perf_Data(
// LCOV_EXCL_STOP 5: fopen error case
}
perf_lines = 0;
- while (fgets(buf, sizeof(buf), rfd) > 0) {
+ while (fgets(buf, sizeof(buf), rfd) != NULL) {
if (perf_lines >= PERF_MAX_LINES) {
break;
}
@@ -2107,7 +2107,7 @@ static void logging_cpuload(void) {
// LCOV_EXCL_STOP 5: kill error case
}
} else {
- while (fgets(buf, sizeof(buf), stdin) > 0) {
+ while (fgets(buf, sizeof(buf), stdin) != NULL) {
// Save ProcessName and Process ID to exec perf
if (logLine >= 2 && perfNum < PERF_MAX_PROCS) {
buf2[0] = 0;
@@ -2491,7 +2491,7 @@ static int write_cpuinfo_work(FILE *wfp) {
}
// LCOV_EXCL_STOP
} else {
- while (fgets(buf, sizeof(buf), stdin) > 0) {
+ while (fgets(buf, sizeof(buf), stdin) != NULL) {
if (logLine == 0) {
if (buf[0] != 'C') {
continue;