[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
* @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>
{
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 << "]");
+ }
}
}