From 6ee9ab91d530cdadeaf2d866c6493181ffde24be Mon Sep 17 00:00:00 2001 From: Zbigniew Kostrzewa Date: Fri, 20 Sep 2013 07:43:20 +0200 Subject: [PATCH] Fix Prevent issue. Reduce number of Ignored issues. [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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/core/src/scoped_dir.cpp b/modules/core/src/scoped_dir.cpp index 2639f7a..96550e6 100644 --- a/modules/core/src/scoped_dir.cpp +++ b/modules/core/src/scoped_dir.cpp @@ -20,6 +20,7 @@ * @brief This file is the implementation scoped directory */ #include +#include #include #include @@ -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 << "]"); + } } } -- 2.34.1