mode_t FILES_STORE_SETTINGS::GetConfModeDir() const
{
mode_t mode = confMode;
-if (statMode & S_IRUSR) mode |= S_IXUSR;
-if (statMode & S_IRGRP) mode |= S_IXGRP;
-if (statMode & S_IROTH) mode |= S_IXOTH;
+if (confMode & S_IRUSR) mode |= S_IXUSR;
+if (confMode & S_IRGRP) mode |= S_IXGRP;
+if (confMode & S_IROTH) mode |= S_IXOTH;
return mode;
}
//-----------------------------------------------------------------------------
return 0;
}
//-----------------------------------------------------------------------------
-int FILES_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> * statTree,
+int FILES_STORE::WriteDetailedStat(const map<IP_DIR_PAIR, STAT_NODE> & statTree,
time_t lastStat,
const string & login) const
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
errorStr = string("fprint failed. Message: '") + strerror(errno) + "'";
printfd(__FILE__, "FILES_STORE::WriteDetailStat - fprintf failed. Message: '%s'\n", strerror(errno));
+ fclose(statFile);
return -1;
}
map<IP_DIR_PAIR, STAT_NODE>::const_iterator stIter;
-stIter = statTree->begin();
+stIter = statTree.begin();
-while (stIter != statTree->end())
+while (stIter != statTree.end())
{
string u, d;
x2str(stIter->second.up, u);
errorStr += strerror(errno);
errorStr += "'";
printfd(__FILE__, "FILES_STORE::WriteDetailStat - fprintf failed. Message: '%s'\n", strerror(errno));
+ fclose(statFile);
return -1;
}
#else
errorStr += strerror(errno);
errorStr += "'";
printfd(__FILE__, "FILES_STORE::WriteDetailStat - fprintf failed. Message: '%s'\n", strerror(errno));
+ fclose(statFile);
return -1;
}
#endif
}
}
-chmod(dn.c_str(), storeSettings.GetConfMode() | S_IXUSR);
+chmod(dn.c_str(), storeSettings.GetConfModeDir());
gettimeofday(&tv, NULL);
return 0;
}
//-----------------------------------------------------------------------------
-