Refactoring on the audit logs implementation

Among of other things, it is now supporting shared file locks between
different process.
This commit is contained in:
Felipe Zimmerle
2016-12-14 10:09:53 -03:00
parent 9707d46e45
commit 2e9a35c358
24 changed files with 661 additions and 260 deletions

View File

@@ -122,12 +122,15 @@ std::list<std::string> expandEnv(const std::string& var, int flags) {
}
void createDir(std::string dir, int mode) {
#if defined _MSC_VER
_mkdir(dir.data());
#elif defined __GNUC__
mkdir(dir.data(), mode);
#endif
bool createDir(std::string dir, int mode, std::string *error) {
int ret = mkdir(dir.data(), mode);
if (ret != 0 && errno != EEXIST) {
error->assign("Not able to create directory: " + dir + ": " \
+ strerror(errno) + ".");
return false;
}
return true;
}