Fix Prevent issue. Reduce number of Ignored issues.
authorZbigniew Kostrzewa <z.kostrzewa@samsung.com>
Fri, 20 Sep 2013 05:43:20 +0000 (07:43 +0200)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Fri, 20 Sep 2013 10:46:33 +0000 (19:46 +0900)
[Issue#]   CID: 12114
[Problem]  Return value not checked
[Cause]    Function returns a value which is not checked
[Solution] Check the returned value and log error if one occurred

[Verification] Build repository

Change-Id: If7c8ef9f8c7682830efa741a9d814438bb7ebe2d

modules/core/src/scoped_dir.cpp

index 2639f7a..96550e6 100644 (file)
@@ -20,6 +20,7 @@
  * @brief       This file is the implementation scoped directory
  */
 #include <dpl/scoped_dir.h>
+#include <dpl/errno_string.h>
 #include <dpl/log/log.h>
 
 #include <fts.h>
@@ -98,7 +99,12 @@ ScopedDir::ScopedDir(const std::string & str, mode_t mode) : BaseType(str)
 {
     if(!str.empty())
     {
-        mkdir(str.c_str(), mode);
+        if (mkdir(str.c_str(), mode) == -1)
+        {
+            std::string errstr = DPL::GetErrnoString();
+            LogError("Error while creating directory: " << str
+                     << " [" << errstr << "]");
+        }
     }
 }