[IOT-2746][IS] Static analysis warning fix. 23/22823/2
authorHarry <h.marappa@samsung.com>
Fri, 13 Oct 2017 14:31:20 +0000 (20:01 +0530)
committerUze Choi <uzchoi@samsung.com>
Tue, 17 Oct 2017 06:53:34 +0000 (06:53 +0000)
Fixed all the static analyzer reported issues in
Simulator native code.

Change-Id: I04c6008c36bb5880bfabee9753433804d43a46bf
Signed-off-by: Harry <h.marappa@samsung.com>
service/simulator/src/common/simulator_logger.cpp

index f1fceb9..d2b89f5 100644 (file)
@@ -41,7 +41,8 @@ class FileLogger : public ILogger
 
         bool open()
         {
-            m_out.open(m_filePath, std::ofstream::out);
+            if (!m_out.is_open())
+                m_out.open(m_filePath, std::ofstream::out);
             return m_out.is_open();
         }
 
@@ -118,4 +119,4 @@ auto simLogger() -> Logger &
 {
     static Logger logger;
     return logger;
-}
\ No newline at end of file
+}