Fix start profiling on get system info error. 10/159610/2
authorVitaliy Cherepanov <v.cherepanov@samsung.com>
Mon, 5 Sep 2016 17:11:02 +0000 (20:11 +0300)
committerVitaliy Cherepanov <v.cherepanov@samsung.com>
Mon, 13 Nov 2017 11:22:44 +0000 (14:22 +0300)
Change-Id: Ic1bb36091be44483c746ace7cdfe045ca2af1a23
Signed-off-by: Vitaliy Cherepanov <v.cherepanov@samsung.com>
daemon/threads.c

index d07a9bb..9c4358e 100644 (file)
@@ -524,14 +524,13 @@ static void *samplingThread(void *data)
                                LOGE("Cannot get system info\n");
                                //do not send sys_info because
                                //it is corrupted
-                               continue;
+                               goto flush_buf;
                        }
 
                        msg = pack_system_info(&sys_info);
                        if (!msg) {
                                LOGE("Cannot pack system info\n");
-                               reset_system_info(&sys_info);
-                               continue;
+                               goto reset_system_info;
                        }
 
                        if (write_to_buf(msg) != 0)
@@ -542,7 +541,9 @@ static void *samplingThread(void *data)
 #endif
 
                        free_msg_data(msg);
+reset_system_info:
                        reset_system_info(&sys_info);
+flush_buf:
                        flush_buf();
                }
                else if(signo == SIGUSR1)