]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/files/file_store.cpp
Исправлена утечка ресурса (файловый дескриптор) в плагине store_files.
[stg.git] / projects / stargazer / plugins / store / files / file_store.cpp
index 556bf8cfd648e0e0510002957a644023ece9ca01..57f825d6e2df91854112a41426460f5add6e3adc 100644 (file)
@@ -438,7 +438,7 @@ mode_t FILES_STORE_SETTINGS::GetConfMode() const
 {
 return confMode;
 }
-//-----------------------------------------------------------------------------
+/*//-----------------------------------------------------------------------------
 mode_t FILES_STORE_SETTINGS::GetConfModeDir() const
 {
 mode_t mode = confMode;
@@ -446,7 +446,7 @@ if (statMode & S_IRUSR) mode |= S_IXUSR;
 if (statMode & S_IRGRP) mode |= S_IXGRP;
 if (statMode & S_IROTH) mode |= S_IXOTH;
 return mode;
-}
+}*/
 //-----------------------------------------------------------------------------
 uid_t  FILES_STORE_SETTINGS::GetConfUID() const
 {
@@ -1895,6 +1895,7 @@ if (fprintf(statFile, "-> %02d.%02d.%02d - %02d.%02d.%02d\n",
     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;
     }
 
@@ -1920,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
@@ -1935,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
@@ -2214,4 +2217,3 @@ fclose(msgFile);
 return 0;
 }
 //-----------------------------------------------------------------------------
-