From 3b56895a961ab712e2dacd85636baec808c1ac8d Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Thu, 9 Dec 2010 14:58:32 +0200 Subject: [PATCH] =?utf8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B0=20=D1=83=D1=82=D0=B5=D1=87=D0=BA=D0=B0=20=D1=80?= =?utf8?q?=D0=B5=D1=81=D1=83=D1=80=D1=81=D0=B0=20(=D1=84=D0=B0=D0=B9=D0=BB?= =?utf8?q?=D0=BE=D0=B2=D1=8B=D0=B9=20=D0=B4=D0=B5=D1=81=D0=BA=D1=80=D0=B8?= =?utf8?q?=D0=BF=D1=82=D0=BE=D1=80)=20=D0=B2=20=D0=BF=D0=BB=D0=B0=D0=B3?= =?utf8?q?=D0=B8=D0=BD=D0=B5=20store=5Ffiles.=20=D0=A3=D1=82=D0=B5=D1=87?= =?utf8?q?=D0=BA=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B8=D1=81=D1=85=D0=BE=D0=B4?= =?utf8?q?=D0=B8=D0=BB=D0=B0=20=D0=BF=D1=80=D0=B8=20=D0=B2=D0=BE=D0=B7?= =?utf8?q?=D0=BD=D0=B8=D0=BA=D0=BD=D0=BE=D0=B2=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?utf8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8,=20=D0=BF=D0=BE=20=D1=8D?= =?utf8?q?=D1=82=D0=BE=D0=BC=D1=83=20=D0=BD=D0=B8=D0=BA=D0=BE=D0=B3=D0=B4?= =?utf8?q?=D0=B0=20=D0=BD=D0=B5=20=D0=BF=D1=80=D0=BE=D1=8F=D0=B2=D0=BB?= =?utf8?q?=D1=8F=D0=BB=D0=B0=D1=81=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../plugins/store/files/file_store.cpp | 2 ++ .../plugins/store/files/file_store.h | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/projects/stargazer/plugins/store/files/file_store.cpp b/projects/stargazer/plugins/store/files/file_store.cpp index fe5ed230..57f825d6 100644 --- a/projects/stargazer/plugins/store/files/file_store.cpp +++ b/projects/stargazer/plugins/store/files/file_store.cpp @@ -1921,6 +1921,7 @@ while (stIter != statTree.end()) errorStr += strerror(errno); errorStr += "'"; printfd(__FILE__, "FILES_STORE::WriteDetailStat - fprintf failed. Message: '%s'\n", strerror(errno)); + fclose(statFile); return -1; } #else @@ -1936,6 +1937,7 @@ while (stIter != statTree.end()) errorStr += strerror(errno); errorStr += "'"; printfd(__FILE__, "FILES_STORE::WriteDetailStat - fprintf failed. Message: '%s'\n", strerror(errno)); + fclose(statFile); return -1; } #endif diff --git a/projects/stargazer/plugins/store/files/file_store.h b/projects/stargazer/plugins/store/files/file_store.h index 13c3a3fa..bf9fbf00 100644 --- a/projects/stargazer/plugins/store/files/file_store.h +++ b/projects/stargazer/plugins/store/files/file_store.h @@ -28,9 +28,10 @@ #ifndef FILE_STORE_H #define FILE_STORE_H -#include #include +#include + #include "base_settings.h" #include "base_store.h" #include "conffiles.h" @@ -80,6 +81,7 @@ private: int ParseGroup(const vector & moduleParams, const string & group, uid_t * uid); int ParseMode(const vector & moduleParams, const string & modeStr, mode_t * mode); int ParseYesNo(const string & value, bool * val); + string errorStr; string workDir; @@ -181,8 +183,8 @@ public: virtual int DelService(const string &) const {return 0;}; //virtual BASE_SETTINGS * GetStoreSettings(); - virtual void SetSettings(const MODULE_SETTINGS & s); - virtual int ParseSettings(); + virtual void SetSettings(const MODULE_SETTINGS & s); + virtual int ParseSettings(); virtual const string & GetVersion() const; private: @@ -191,12 +193,13 @@ private: virtual int WriteLogString(const string & str, const string & login) const; virtual int WriteLog2String(const string & str, const string & login) const; - int RemoveDir(const char * path) const; - int GetFilesList(vector * filesList, const string & directory, mode_t mode, const string & ext) const; - mutable string errorStr; - string version; - FILES_STORE_SETTINGS storeSettings; - MODULE_SETTINGS settings; + int RemoveDir(const char * path) const; + int GetFilesList(vector * filesList, const string & directory, mode_t mode, const string & ext) const; + + mutable string errorStr; + string version; + FILES_STORE_SETTINGS storeSettings; + MODULE_SETTINGS settings; mutable pthread_mutex_t mutex; }; //----------------------------------------------------------------------------- -- 2.44.2