Fixed Build error. 13.93.0 needlefish/13.93.0 needlefish_13.93.0
authorToshiaki Takeuchi <toshiaki.takeuchi@woven-planet.global>
Wed, 20 Jul 2022 04:57:59 +0000 (13:57 +0900)
committerToshiaki Takeuchi <toshiaki.takeuchi@woven-planet.global>
Wed, 20 Jul 2022 05:17:22 +0000 (14:17 +0900)
fgets return should be compared with NULL not 0.

Bug-AGL: SPEC-4376

Signed-off-by: Toshiaki Takeuchi <toshiaki.takeuchi@woven-planet.global>
service/system/resource_manager/server/src/resm.cpp

index 6bed6bd..f44d9b4 100755 (executable)
@@ -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;